@@ -169,7 +169,7 @@ char* update_config_version(const char* release_type)
169
169
return version ;
170
170
}
171
171
172
- void insert_release ()
172
+ void insert_release (_Bool pushed )
173
173
{
174
174
sqlite3 * db ;
175
175
sqlite3_open (SQLITE_DB , & db );
@@ -182,7 +182,7 @@ void insert_release()
182
182
query_builder_t * qb = create_query_builder ();
183
183
insert_q (qb , TABLE_RELEASES );
184
184
columns_q (qb , FIELDS_RELEASES );
185
- char * values = clib_format_text ("'%s', '%s'" , version , date .full );
185
+ char * values = clib_format_text ("'%s', '%s', %d " , version , date .full , pushed );
186
186
values_q (qb , values );
187
187
char * query = build_query (qb );
188
188
@@ -488,24 +488,25 @@ void command_release(Options options)
488
488
PANIC ("Release type '%s' should be 'major', 'minor' or 'patch'. Try %s release -h" , release_type , EXECUTABLE_NAME );
489
489
}
490
490
491
+ sqlite3 * db ;
492
+ sqlite3_open (SQLITE_DB , & db );
493
+ _Bool release = select_always_push (db );
494
+ sqlite3_close (db );
495
+
496
+ _Bool should_push = release || options .push ;
497
+
491
498
char * version = update_config_version (release_type );
492
- insert_release ();
499
+ insert_release (should_push );
493
500
char * query = clib_format_text ("UPDATE Entries SET version = '%s' WHERE version = 'unreleased'" , version );
494
501
sqlite_execute_sql (SQLITE_DB , query );
495
502
496
503
command_export (options );
497
504
498
-
499
- sqlite3 * db ;
500
- sqlite3_open (SQLITE_DB , & db );
501
- _Bool release = select_always_export (db );
502
- sqlite3_close (db );
505
+ if (!should_push ) return ; // Do not push the release on Github
503
506
504
- if (release || options .push ) {
505
- char * gh_command = clib_format_text ("gh release create v%s -F %s/%s.md -t v%s" , version , CHANGELOG_DIR , version , version );
506
- clib_execute_command (gh_command );
507
- free (gh_command );
508
- }
507
+ char * gh_command = clib_format_text ("gh release create v%s -F %s/%s.md -t v%s" , version , CHANGELOG_DIR , version , version );
508
+ clib_execute_command (gh_command );
509
+ free (gh_command );
509
510
}
510
511
511
512
void list_releases (sqlite3 * db , Options options , char * condition , char * order_by )
0 commit comments