From bb3998b0c54704d064b1bf3a42e511863a4fcf7e Mon Sep 17 00:00:00 2001 From: Heather Kusmierz Date: Tue, 1 Aug 2023 16:15:36 -0400 Subject: [PATCH 1/3] ci: migrate to python semantic release --- .github/workflows/release.yaml | 17 ++++---- .github/workflows/ui_test.yaml | 4 +- package.json | 78 +++++++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 24456926..03cf6101 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,18 +8,17 @@ jobs: release: name: Release runs-on: ubuntu-latest + concurrency: release + permissions: + id-token: write + contents: write steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3 + - name: Python Semantic Release + uses: python-semantic-release/python-semantic-release@master with: - node-version: "lts/*" - - name: Install dependencies - run: npm install - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx semantic-release \ No newline at end of file + github_token: ${{ secrets.GITHUB_TOKEN }} + root_options: -c package.json \ No newline at end of file diff --git a/.github/workflows/ui_test.yaml b/.github/workflows/ui_test.yaml index 302bde0d..05ed3acf 100644 --- a/.github/workflows/ui_test.yaml +++ b/.github/workflows/ui_test.yaml @@ -81,11 +81,11 @@ jobs: ${{ runner.os }}- - name: Install Dependencies - run: bash ${{GITHUB_WORKSPACE}}/.github/helper/install_dependencies.sh + run: bash ${{github.workspace}}/.github/helper/install_dependencies.sh - name: Install run: | - bash ${{GITHUB_WORKSPACE}}/.github/helper/install.sh + bash ${{github.workspace}}/.github/helper/install.sh - name: Cypress run uses: cypress-io/github-action@v4 diff --git a/package.json b/package.json index c284887d..f0716c3b 100644 --- a/package.json +++ b/package.json @@ -23,5 +23,81 @@ "version-13", "version-14" ] - } + }, + "semantic_release": { + "assets": [], + "branches": { + "version-13": { + "match": "version-13", + "prerelease": false + }, + "version-14": { + "match": "version-14", + "prerelease": false + } + }, + "changelog": { + "template_dir": "templates", + "changelog_file": "CHANGELOG.md", + "exclude_commit_patterns": [], + "environment": { + "block_start_string": "{%", + "block_end_string": "%}", + "variable_start_string": "{{", + "variable_end_string": "}}", + "comment_start_string": "{#", + "comment_end_string": "#}", + "trim_blocks": false, + "lstrip_blocks": false, + "newline_sequence": "\n", + "keep_trailing_newline": false, + "extensions": [], + "autoescape": true + } + }, + "commit_author": { + "env": "GIT_COMMIT_AUTHOR", + "default": "semantic-release " + }, + "commit_message": "{version}\n\nAutomatically generated by python-semantic-release", + "commit_parser": "angular", + "commit_parser_options": { + "allowed_tags": [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "style", + "refactor", + "test" + ], + "minor_tags": [ + "feat" + ], + "patch_tags": [ + "fix", + "perf" + ] + }, + "logging_use_named_masks": false, + "major_on_zero": true, + "remote": { + "name": "upstream", + "token": { + "env": "GH_TOKEN" + }, + "type": "github", + "ignore_token_for_push": false + }, + "tag_format": "v{version}", + "publish": { + "dist_glob_patterns": [ + "dist/*" + ], + "upload_to_vcs_release": true + } + } } From 8db39e5b1e0eb10fe6f8da93e26e211514163c2b Mon Sep 17 00:00:00 2001 From: Heather Kusmierz Date: Wed, 2 Aug 2023 16:19:26 -0400 Subject: [PATCH 2/3] ci: add version variable file --- package.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f0716c3b..5dd6941c 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,6 @@ "publishConfig": { "access": "restricted" }, - "release": { - "branches": [ - "version-13", - "version-14" - ] - }, "semantic_release": { "assets": [], "branches": { @@ -36,6 +30,9 @@ "prerelease": false } }, + "version_variables": [ + "check_run/__init__.py:__version__" + ], "changelog": { "template_dir": "templates", "changelog_file": "CHANGELOG.md", From 5c554a4dbcdf23c374badbe1be66a9b5553adf67 Mon Sep 17 00:00:00 2001 From: Heather Kusmierz Date: Thu, 3 Aug 2023 14:33:41 -0400 Subject: [PATCH 3/3] ci: update remote name --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5dd6941c..587615a5 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "logging_use_named_masks": false, "major_on_zero": true, "remote": { - "name": "upstream", + "name": "origin", "token": { "env": "GH_TOKEN" },