From e076c1c9be395357f5e9bf69e25e0087e4aa50fd Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:04:39 -0700 Subject: [PATCH 01/26] Add workflow --- .github/workflows/tag-release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/tag-release.yml diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml new file mode 100644 index 0000000000000..cbdea9b28f701 --- /dev/null +++ b/.github/workflows/tag-release.yml @@ -0,0 +1,23 @@ +# + +name: Tag release and update Changelog + +on: + workflow_dispatch: + inputs: + release-sha: + required: true + type: string + push: + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + - name: Tag release sha + uses: actions/github-script@v7 + with: + script: | + console.log('running'); From cfc497aa12e66411d18d337407a41e84c1474ad5 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:14:04 -0700 Subject: [PATCH 02/26] Fix indent --- .github/workflows/tag-release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index cbdea9b28f701..8011ce01521ba 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -1,5 +1,4 @@ -# - +# Tag release and update changelog name: Tag release and update Changelog on: @@ -18,6 +17,6 @@ jobs: uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - name: Tag release sha uses: actions/github-script@v7 - with: - script: | - console.log('running'); + with: + script: | + console.log('running'); From b7ca27c4313b8282e1023d90a31f323f1d16ac83 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:24:16 -0700 Subject: [PATCH 03/26] create tag --- .github/workflows/tag-release.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 8011ce01521ba..7981b5b95bd14 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -4,10 +4,11 @@ name: Tag release and update Changelog on: workflow_dispatch: inputs: + release-version: + required: true release-sha: required: true type: string - push: jobs: create-release: @@ -20,3 +21,16 @@ jobs: with: script: | console.log('running'); + const tag_sha = '${{ inputs.release-sha }}'; + const release_version = '${{ inputs.release-version }}'; + const regex = /Release ([0-9]+.[0-9]+.[0-9]+)/; + const match = message.match(regex); + if (!match) { + throw new Error('Malformed release version') + } + await github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${release_version}`, + sha: tag_sha + }) From de1c7f7efd7cbe0b7306e5a62ba416af701aa4c3 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:28:40 -0700 Subject: [PATCH 04/26] fix match --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 7981b5b95bd14..ece5ed8194601 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -24,7 +24,7 @@ jobs: const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ inputs.release-version }}'; const regex = /Release ([0-9]+.[0-9]+.[0-9]+)/; - const match = message.match(regex); + const match = release_version.match(regex); if (!match) { throw new Error('Malformed release version') } From 6591d3ed6ecacbeaa0ed5ff94036f618ef0822f2 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:32:30 -0700 Subject: [PATCH 05/26] debug output --- .github/workflows/tag-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index ece5ed8194601..1bd567e8d4327 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -23,14 +23,15 @@ jobs: console.log('running'); const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ inputs.release-version }}'; + console.log(`Version ${release_version} at SHA ${tag_SHA}`); const regex = /Release ([0-9]+.[0-9]+.[0-9]+)/; const match = release_version.match(regex); if (!match) { - throw new Error('Malformed release version') + throw new Error('Malformed release version'); } await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: `refs/tags/${release_version}`, sha: tag_sha - }) + }); From e06afb607be08f3fd0aaf6e0c675f24fca1147b0 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:33:31 -0700 Subject: [PATCH 06/26] fix debug output --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 1bd567e8d4327..87de3330bdcc2 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -23,7 +23,7 @@ jobs: console.log('running'); const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ inputs.release-version }}'; - console.log(`Version ${release_version} at SHA ${tag_SHA}`); + console.log(`Version ${release_version} at SHA ${tag_sha}`); const regex = /Release ([0-9]+.[0-9]+.[0-9]+)/; const match = release_version.match(regex); if (!match) { From 96a2fc11539356fe76073382965e9645de418d39 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 11:37:54 -0700 Subject: [PATCH 07/26] fix match --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 87de3330bdcc2..363f28f6fdc4c 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -24,7 +24,7 @@ jobs: const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ inputs.release-version }}'; console.log(`Version ${release_version} at SHA ${tag_sha}`); - const regex = /Release ([0-9]+.[0-9]+.[0-9]+)/; + const regex = /^[0-9]+.[0-9]+.[0-9]+$/; const match = release_version.match(regex); if (!match) { throw new Error('Malformed release version'); From 6941203e70cee4de380e63920ad342e52be0c6d9 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 15:24:09 -0700 Subject: [PATCH 08/26] create release commit --- .github/workflows/tag-release.yml | 7 +++++++ tools/maint/create_release.py | 26 ++++++++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 363f28f6fdc4c..08a146bd4035b 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -35,3 +35,10 @@ jobs: ref: `refs/tags/${release_version}`, sha: tag_sha }); + - name: Update Changelog + run: python3 tools/maint/create_release.py --action + - name: Create Changelog PR + uses: peter-evans/create-pull-request@v6 + with: + title: `Mark ${{ env.RELEASE_VERSION }} as released` + delete-branch: true diff --git a/tools/maint/create_release.py b/tools/maint/create_release.py index 11f57038b6874..3442494eb460a 100755 --- a/tools/maint/create_release.py +++ b/tools/maint/create_release.py @@ -16,11 +16,13 @@ from tools import shared, utils -def main(): +def main(argv): if subprocess.check_output(['git', 'status', '-uno', '--porcelain'], cwd=root_dir).strip(): print('tree is not clean') return 1 + is_github_runner = len(argv) > 1 and argv[1] == '--action' + shared.set_version_globals() release_version = [shared.EMSCRIPTEN_VERSION_MAJOR, shared.EMSCRIPTEN_VERSION_MINOR, @@ -58,20 +60,24 @@ def main(): branch_name = 'version_' + release_version - # Create a new git branch - subprocess.check_call(['git', 'checkout', '-b', branch_name, 'upstream/main'], cwd=root_dir) + if is_github_runner: # For GitHub Actions workflows + with open(os.environ['GITHUB_ENV'], 'a') as f: + f.write(f'RELEASE_VERSION={release_version}') + else: # Local use + # Create a new git branch + subprocess.check_call(['git', 'checkout', '-b', branch_name, 'upstream/main'], cwd=root_dir) - # Create auto-generated changes to the new git branch - subprocess.check_call(['git', 'add', '-u', '.'], cwd=root_dir) - subprocess.check_call(['git', 'commit', '-m', f'Mark {release_version} as released'], cwd=root_dir) - print('New release created in branch: `%s`' % branch_name) + # Create auto-generated changes to the new git branch + subprocess.check_call(['git', 'add', '-u', '.'], cwd=root_dir) + subprocess.check_call(['git', 'commit', '-m', f'Mark {release_version} as released'], cwd=root_dir) + print('New release created in branch: `%s`' % branch_name) - # Push new branch to upstream - subprocess.check_call(['git', 'push', 'upstream', branch_name], cwd=root_dir) + # Push new branch to upstream + subprocess.check_call(['git', 'push', 'upstream', branch_name], cwd=root_dir) # TODO(sbc): Maybe create the tag too return 0 if __name__ == '__main__': - sys.exit(main()) + sys.exit(main(sys.argv)) From cc1a57397d4a17a03803cd54a26212537f7931c3 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 15:26:46 -0700 Subject: [PATCH 09/26] remove quote --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 08a146bd4035b..578cfaba62770 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -40,5 +40,5 @@ jobs: - name: Create Changelog PR uses: peter-evans/create-pull-request@v6 with: - title: `Mark ${{ env.RELEASE_VERSION }} as released` + title: Mark ${{ env.RELEASE_VERSION }} as released delete-branch: true From dfb03e042099bfa5b63fabcf8534517d1dc2e28f Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 15:40:05 -0700 Subject: [PATCH 10/26] move set_version_globals to utils --- tools/maint/create_release.py | 8 ++++---- tools/shared.py | 10 +--------- tools/utils.py | 8 ++++++++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/maint/create_release.py b/tools/maint/create_release.py index 3442494eb460a..a1ddc05958253 100755 --- a/tools/maint/create_release.py +++ b/tools/maint/create_release.py @@ -13,7 +13,7 @@ root_dir = os.path.dirname(os.path.dirname(script_dir)) sys.path.insert(0, root_dir) -from tools import shared, utils +from tools import utils def main(argv): @@ -23,10 +23,10 @@ def main(argv): is_github_runner = len(argv) > 1 and argv[1] == '--action' - shared.set_version_globals() + utils.set_version_globals() - release_version = [shared.EMSCRIPTEN_VERSION_MAJOR, shared.EMSCRIPTEN_VERSION_MINOR, - shared.EMSCRIPTEN_VERSION_TINY] + release_version = [utils.EMSCRIPTEN_VERSION_MAJOR, utils.EMSCRIPTEN_VERSION_MINOR, + utils.EMSCRIPTEN_VERSION_TINY] new_dev_version = list(release_version) new_dev_version[2] += 1 diff --git a/tools/shared.py b/tools/shared.py index 1d2224d19f02f..db299ccf45d4b 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -40,7 +40,7 @@ logging.basicConfig(format='%(name)s:%(levelname)s: %(message)s', level=log_level) colored_logger.enable() -from .utils import path_from_root, exit_with_error, safe_ensure_dirs, WINDOWS +from .utils import path_from_root, exit_with_error, safe_ensure_dirs, WINDOWS, set_version_globals from . import cache, tempfiles from . import diagnostics from . import config @@ -424,14 +424,6 @@ def check_node(): exit_with_error('the configured node executable (%s) does not seem to work, check the paths in %s (%s)', config.NODE_JS, config.EM_CONFIG, str(e)) -def set_version_globals(): - global EMSCRIPTEN_VERSION, EMSCRIPTEN_VERSION_MAJOR, EMSCRIPTEN_VERSION_MINOR, EMSCRIPTEN_VERSION_TINY - filename = path_from_root('emscripten-version.txt') - EMSCRIPTEN_VERSION = utils.read_file(filename).strip().strip('"') - parts = [int(x) for x in EMSCRIPTEN_VERSION.split('-')[0].split('.')] - EMSCRIPTEN_VERSION_MAJOR, EMSCRIPTEN_VERSION_MINOR, EMSCRIPTEN_VERSION_TINY = parts - - def generate_sanity(): return f'{EMSCRIPTEN_VERSION}|{config.LLVM_ROOT}\n' diff --git a/tools/utils.py b/tools/utils.py index 539e519a53932..e8a690808b829 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -108,3 +108,11 @@ def delete_contents(dirname, exclude=None): delete_dir(entry) else: delete_file(entry) + + +def set_version_globals(): + global EMSCRIPTEN_VERSION, EMSCRIPTEN_VERSION_MAJOR, EMSCRIPTEN_VERSION_MINOR, EMSCRIPTEN_VERSION_TINY + filename = path_from_root('emscripten-version.txt') + EMSCRIPTEN_VERSION = read_file(filename).strip().strip('"') + parts = [int(x) for x in EMSCRIPTEN_VERSION.split('-')[0].split('.')] + EMSCRIPTEN_VERSION_MAJOR, EMSCRIPTEN_VERSION_MINOR, EMSCRIPTEN_VERSION_TINY = parts \ No newline at end of file From 63c40def74743399a704634bbf90cef820933857 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 15:46:23 -0700 Subject: [PATCH 11/26] reorder steps and automatic release version --- .github/workflows/tag-release.yml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 578cfaba62770..f14e2536946d9 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -4,8 +4,6 @@ name: Tag release and update Changelog on: workflow_dispatch: inputs: - release-version: - required: true release-sha: required: true type: string @@ -16,13 +14,21 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + # Updates changelog and writes the release version into the environment + - name: Update Changelog + run: python3 tools/maint/create_release.py --action + - name: Create Changelog PR + uses: peter-evans/create-pull-request@v6 + with: + title: Mark ${{ env.RELEASE_VERSION }} as released + delete-branch: true - name: Tag release sha uses: actions/github-script@v7 with: script: | console.log('running'); const tag_sha = '${{ inputs.release-sha }}'; - const release_version = '${{ inputs.release-version }}'; + const release_version = '${{ env.RELEASE_VERSION }}'; console.log(`Version ${release_version} at SHA ${tag_sha}`); const regex = /^[0-9]+.[0-9]+.[0-9]+$/; const match = release_version.match(regex); @@ -35,10 +41,3 @@ jobs: ref: `refs/tags/${release_version}`, sha: tag_sha }); - - name: Update Changelog - run: python3 tools/maint/create_release.py --action - - name: Create Changelog PR - uses: peter-evans/create-pull-request@v6 - with: - title: Mark ${{ env.RELEASE_VERSION }} as released - delete-branch: true From b257d3cca1967ad826e2a11c1b083baa0e46495b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 16:11:15 -0700 Subject: [PATCH 12/26] update emscripten version --- emcc.py | 6 +++--- test/test_core.py | 4 ++-- test/test_other.py | 6 +++--- tools/link.py | 2 +- tools/shared.py | 2 +- tools/system_libs.py | 6 +++--- tools/utils.py | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/emcc.py b/emcc.py index d02adb34d3784..735889e4e7b6c 100644 --- a/emcc.py +++ b/emcc.py @@ -45,7 +45,7 @@ from tools import config from tools import cache from tools.settings import default_setting, user_settings, settings, MEM_SIZE_SETTINGS, COMPILE_TIME_SETTINGS -from tools.utils import read_file, removeprefix +from tools.utils import read_file, removeprefix, EMSCRIPTEN_VERSION logger = logging.getLogger('emcc') @@ -569,7 +569,7 @@ def run(args): return 0 if '-dumpversion' in args: # gcc's doc states "Print the compiler version [...] and don't do anything else." - print(shared.EMSCRIPTEN_VERSION) + print(EMSCRIPTEN_VERSION) return 0 if '--cflags' in args: @@ -1099,7 +1099,7 @@ def version_string(): elif os.path.exists(utils.path_from_root('emscripten-revision.txt')): rev = read_file(utils.path_from_root('emscripten-revision.txt')).strip() revision_suffix = ' (%s)' % rev - return f'emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) {shared.EMSCRIPTEN_VERSION}{revision_suffix}' + return f'emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) {EMSCRIPTEN_VERSION}{revision_suffix}' def parse_args(newargs): diff --git a/test/test_core.py b/test/test_core.py index 896f3c27eddad..4ddf04b74f4db 100644 --- a/test/test_core.py +++ b/test/test_core.py @@ -19,7 +19,7 @@ from tools.shared import PIPE from tools.shared import EMCC, EMAR, FILE_PACKAGER -from tools.utils import WINDOWS, MACOS, write_file, delete_file +from tools.utils import WINDOWS, MACOS, write_file, delete_file, EMSCRIPTEN_VERSION from tools import shared, building, config, webassembly import common from common import RunnerCore, path_from_root, requires_native_clang, test_file, create_file @@ -1802,7 +1802,7 @@ def test_emscripten_get_compiler_setting(self): self.do_runf(src, 'You must build with -sRETAIN_COMPILER_SETTINGS', assert_returncode=NON_ZERO) self.clear_setting('ASSERTIONS') self.set_setting('RETAIN_COMPILER_SETTINGS') - self.do_runf(src, read_file(output).replace('waka', shared.EMSCRIPTEN_VERSION)) + self.do_runf(src, read_file(output).replace('waka', EMSCRIPTEN_VERSION)) def test_emscripten_has_asyncify(self): src = r''' diff --git a/test/test_other.py b/test/test_other.py index ecf1315053f31..99c5cf6a61c7c 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -484,7 +484,7 @@ def test_emcc_basics(self, compiler, suffix): # -dumpversion output = self.run_process([compiler, '-dumpversion'], stdout=PIPE, stderr=PIPE) - self.assertEqual(shared.EMSCRIPTEN_VERSION, output.stdout.strip()) + self.assertEqual(utils.EMSCRIPTEN_VERSION, output.stdout.strip()) # properly report source code errors, and stop there self.clear() @@ -5765,7 +5765,7 @@ def test_emversion(self): major: %d minor: %d tiny: %d -''' % (shared.EMSCRIPTEN_VERSION_MAJOR, shared.EMSCRIPTEN_VERSION_MINOR, shared.EMSCRIPTEN_VERSION_TINY) +''' % (utils.EMSCRIPTEN_VERSION_MAJOR, utils.EMSCRIPTEN_VERSION_MINOR, utils.EMSCRIPTEN_VERSION_TINY) self.do_runf('src.c', expected) self.do_runf('src.c', expected, emcc_args=['-sSTRICT']) @@ -5845,7 +5845,7 @@ def test_dashE(self): def test(args): print(args) out = self.run_process([EMXX, 'src.cpp', '-E'] + args, stdout=PIPE).stdout - self.assertContained('%d %d %d __attribute__((used))' % (shared.EMSCRIPTEN_VERSION_MAJOR, shared.EMSCRIPTEN_VERSION_MINOR, shared.EMSCRIPTEN_VERSION_TINY), out) + self.assertContained('%d %d %d __attribute__((used))' % (utils.EMSCRIPTEN_VERSION_MAJOR, utils.EMSCRIPTEN_VERSION_MINOR, utils.EMSCRIPTEN_VERSION_TINY), out) test([]) test(['-lembind']) diff --git a/tools/link.py b/tools/link.py index 2b6ec30226ce9..f895e6d5dc8cd 100644 --- a/tools/link.py +++ b/tools/link.py @@ -1757,7 +1757,7 @@ def get_full_import_name(name): 'emscripten_stack_get_base', 'emscripten_stack_get_end'] - settings.EMSCRIPTEN_VERSION = shared.EMSCRIPTEN_VERSION + settings.EMSCRIPTEN_VERSION = utils.EMSCRIPTEN_VERSION settings.SOURCE_MAP_BASE = options.source_map_base or '' settings.LINK_AS_CXX = (shared.run_via_emxx or settings.DEFAULT_TO_CXX) and '-nostdlib++' not in newargs diff --git a/tools/shared.py b/tools/shared.py index db299ccf45d4b..60fa92e01c4cb 100644 --- a/tools/shared.py +++ b/tools/shared.py @@ -425,7 +425,7 @@ def check_node(): def generate_sanity(): - return f'{EMSCRIPTEN_VERSION}|{config.LLVM_ROOT}\n' + return f'{utils.EMSCRIPTEN_VERSION}|{config.LLVM_ROOT}\n' @memoize diff --git a/tools/system_libs.py b/tools/system_libs.py index 49dcd81172bfd..8cb1df9f888d3 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -2483,9 +2483,9 @@ def install_system_headers(stamp): version_file = cache.get_include_dir('emscripten/version.h') utils.write_file(version_file, textwrap.dedent(f'''\ /* Automatically generated by tools/system_libs.py */ - #define __EMSCRIPTEN_major__ {shared.EMSCRIPTEN_VERSION_MAJOR} - #define __EMSCRIPTEN_minor__ {shared.EMSCRIPTEN_VERSION_MINOR} - #define __EMSCRIPTEN_tiny__ {shared.EMSCRIPTEN_VERSION_TINY} + #define __EMSCRIPTEN_major__ {utils.EMSCRIPTEN_VERSION_MAJOR} + #define __EMSCRIPTEN_minor__ {utils.EMSCRIPTEN_VERSION_MINOR} + #define __EMSCRIPTEN_tiny__ {utils.EMSCRIPTEN_VERSION_TINY} ''')) # Create a stamp file that signal that the headers have been installed diff --git a/tools/utils.py b/tools/utils.py index e8a690808b829..ea154d749daf4 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -115,4 +115,4 @@ def set_version_globals(): filename = path_from_root('emscripten-version.txt') EMSCRIPTEN_VERSION = read_file(filename).strip().strip('"') parts = [int(x) for x in EMSCRIPTEN_VERSION.split('-')[0].split('.')] - EMSCRIPTEN_VERSION_MAJOR, EMSCRIPTEN_VERSION_MINOR, EMSCRIPTEN_VERSION_TINY = parts \ No newline at end of file + EMSCRIPTEN_VERSION_MAJOR, EMSCRIPTEN_VERSION_MINOR, EMSCRIPTEN_VERSION_TINY = parts From c39d6e72f45620f6927d837a0379b0270c4f64da Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 23 Aug 2024 16:42:35 -0700 Subject: [PATCH 13/26] remove debug print --- .github/workflows/tag-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index f14e2536946d9..eda57bc865221 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -26,7 +26,6 @@ jobs: uses: actions/github-script@v7 with: script: | - console.log('running'); const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ env.RELEASE_VERSION }}'; console.log(`Version ${release_version} at SHA ${tag_sha}`); From a4daa3594ab096080ce88ee51d62df3f65a5baa0 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 14:16:36 -0700 Subject: [PATCH 14/26] review comment --- emcc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emcc.py b/emcc.py index 735889e4e7b6c..d28d76239956b 100644 --- a/emcc.py +++ b/emcc.py @@ -569,7 +569,7 @@ def run(args): return 0 if '-dumpversion' in args: # gcc's doc states "Print the compiler version [...] and don't do anything else." - print(EMSCRIPTEN_VERSION) + print(utils.EMSCRIPTEN_VERSION) return 0 if '--cflags' in args: @@ -1099,7 +1099,7 @@ def version_string(): elif os.path.exists(utils.path_from_root('emscripten-revision.txt')): rev = read_file(utils.path_from_root('emscripten-revision.txt')).strip() revision_suffix = ' (%s)' % rev - return f'emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) {EMSCRIPTEN_VERSION}{revision_suffix}' + return f'emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) {utils.EMSCRIPTEN_VERSION}{revision_suffix}' def parse_args(newargs): From 09b318e9ab9b92f1a591dd0eca915537d4adb7a8 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 14:27:45 -0700 Subject: [PATCH 15/26] add expclicit write --- .github/workflows/tag-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index eda57bc865221..d21f339d1de97 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -1,5 +1,7 @@ # Tag release and update changelog name: Tag release and update Changelog +permissions: + contents: write on: workflow_dispatch: From c3945b2c4f629d93f31521ee1b7874fd7865cfb2 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 14:29:58 -0700 Subject: [PATCH 16/26] try different permissions --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index d21f339d1de97..c6d613ce17bda 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -1,7 +1,7 @@ # Tag release and update changelog name: Tag release and update Changelog permissions: - contents: write + write-all on: workflow_dispatch: From 0dd92e157203ec7c1c10ad919019ad7160ead46b Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 15:09:42 -0700 Subject: [PATCH 17/26] remove permissions --- .github/workflows/tag-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index c6d613ce17bda..eda57bc865221 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -1,7 +1,5 @@ # Tag release and update changelog name: Tag release and update Changelog -permissions: - write-all on: workflow_dispatch: From ec82e74eefa238f4ee7b24537a5321ba9153c3bd Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 17:01:19 -0700 Subject: [PATCH 18/26] log --- .github/workflows/tag-release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index eda57bc865221..19c2186763b42 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -34,6 +34,8 @@ jobs: if (!match) { throw new Error('Malformed release version'); } + console.log(context.repo.owner); + console.log(context.repo.repo); await github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, From b8acef95827fcde3737832c659ea86ee197a2272 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 17:03:07 -0700 Subject: [PATCH 19/26] remove PR creation --- .github/workflows/tag-release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 19c2186763b42..db87166edfcf6 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -17,11 +17,6 @@ jobs: # Updates changelog and writes the release version into the environment - name: Update Changelog run: python3 tools/maint/create_release.py --action - - name: Create Changelog PR - uses: peter-evans/create-pull-request@v6 - with: - title: Mark ${{ env.RELEASE_VERSION }} as released - delete-branch: true - name: Tag release sha uses: actions/github-script@v7 with: From 8547fee123d54b69583df450cd565e136899fc04 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Mon, 26 Aug 2024 18:13:41 -0700 Subject: [PATCH 20/26] try explicit token --- .github/workflows/tag-release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index db87166edfcf6..79c48d41b185d 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -20,6 +20,7 @@ jobs: - name: Tag release sha uses: actions/github-script@v7 with: + github-token: ${{ secrets.TEST_TOKEN }} script: | const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ env.RELEASE_VERSION }}'; From aaf7ed31d58fb25bce160093fbd3ff798bed1945 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 27 Aug 2024 13:19:40 -0700 Subject: [PATCH 21/26] explicit auto token --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 79c48d41b185d..8da2935d2f748 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -20,7 +20,7 @@ jobs: - name: Tag release sha uses: actions/github-script@v7 with: - github-token: ${{ secrets.TEST_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} script: | const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ env.RELEASE_VERSION }}'; From cc969092f96e0867e301f9b22047c467f26dc98d Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 27 Aug 2024 13:40:43 -0700 Subject: [PATCH 22/26] another --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 8da2935d2f748..08506b141cc35 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -20,7 +20,7 @@ jobs: - name: Tag release sha uses: actions/github-script@v7 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.TEST_PAT }} script: | const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ env.RELEASE_VERSION }}'; From 698e5317f94b8ba219639d8e62ec373e0d929838 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 27 Aug 2024 13:47:14 -0700 Subject: [PATCH 23/26] back to TEST_TOKEN --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 08506b141cc35..79c48d41b185d 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -20,7 +20,7 @@ jobs: - name: Tag release sha uses: actions/github-script@v7 with: - github-token: ${{ secrets.TEST_PAT }} + github-token: ${{ secrets.TEST_TOKEN }} script: | const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ env.RELEASE_VERSION }}'; From bbe60a71aa07f42a1005e1e709c5676a6cdd4f3c Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 30 Aug 2024 09:45:20 -0700 Subject: [PATCH 24/26] use EMSCRIPTEN_BOT_TOKEN --- .github/workflows/tag-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index 79c48d41b185d..a13dd2569f1d3 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -20,7 +20,7 @@ jobs: - name: Tag release sha uses: actions/github-script@v7 with: - github-token: ${{ secrets.TEST_TOKEN }} + github-token: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }} script: | const tag_sha = '${{ inputs.release-sha }}'; const release_version = '${{ env.RELEASE_VERSION }}'; From 0efdb1b0828bc60e5c37d4da5857092334668609 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 30 Aug 2024 10:00:26 -0700 Subject: [PATCH 25/26] put back PR creation --- .github/workflows/tag-release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tag-release.yml b/.github/workflows/tag-release.yml index a13dd2569f1d3..f300dbd27df59 100644 --- a/.github/workflows/tag-release.yml +++ b/.github/workflows/tag-release.yml @@ -17,6 +17,11 @@ jobs: # Updates changelog and writes the release version into the environment - name: Update Changelog run: python3 tools/maint/create_release.py --action + - name: Create Changelog PR + uses: peter-evans/create-pull-request@v6 + with: + title: Mark ${{ env.RELEASE_VERSION }} as released + delete-branch: true - name: Tag release sha uses: actions/github-script@v7 with: From 5dabacbb6d90ee5941395fa9a11a2cd09f92f77e Mon Sep 17 00:00:00 2001 From: emscripten-bot <179889221+emscripten-bot@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:15:32 +0000 Subject: [PATCH 26/26] [create-pull-request] automated change --- ChangeLog.md | 5 ++++- emscripten-version.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 2b625630451d9..40acb6d0a657f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -18,9 +18,12 @@ to browse the changes between the tags. See docs/process.md for more on how version tagging works. -3.1.66 (in development) +3.1.67 (in development) ----------------------- +3.1.66 - 08/30/24 +----------------- + 3.1.65 - 08/22/24 ----------------- - A new `--emit-minification-map` command line flag was added, which can be used diff --git a/emscripten-version.txt b/emscripten-version.txt index 54e0b4eb46b6d..05e89e2e2c672 100644 --- a/emscripten-version.txt +++ b/emscripten-version.txt @@ -1 +1 @@ -3.1.66-git +3.1.67-git