From 912daa5726152e00e02f12a2172886b36fb53275 Mon Sep 17 00:00:00 2001 From: Bjarten Date: Fri, 18 Oct 2024 16:16:02 +0900 Subject: [PATCH 01/11] fix: release workflow --- .github/workflows/release.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b895907..f142230 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,16 +2,6 @@ name: Create New Release on: workflow_dispatch: - inputs: - dry-run: - description: | - Perform a dry run release (check for testing, uncheck for real release) - - Checked (true): Simulates the release process without making changes - - Unchecked (false): Creates an actual release with version bump - Note: Ensure all desired changes are merged to main before releasing - required: true - default: true - type: boolean jobs: release: @@ -48,8 +38,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - if [ "${{ github.event.inputs.dry-run }}" = "true" ]; then - semantic-release publish --dry-run --verbose - else - semantic-release publish --verbose - fi + semantic-release publish --log-level debug From d496516092b297ab4914e87ca9d25d66674ab972 Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:18:07 +0900 Subject: [PATCH 02/11] fix: remove log level --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f142230..2543c74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,4 +38,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - semantic-release publish --log-level debug + semantic-release publish --debug From 8fceb3befecb6c793844e5fcf5f41ebaabed19d7 Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:19:53 +0900 Subject: [PATCH 03/11] fix: remove debug flag --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2543c74..86447a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,4 +38,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - semantic-release publish --debug + semantic-release publish From 437e955944718277af7e267683972b216934743f Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:26:56 +0900 Subject: [PATCH 04/11] wip: add current branch to toml file temporarily --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 98d4951..db362d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ dependencies = [ [tool.semantic_release] version_variable = "early_stopping_pytorch/__init__.py:__version__" branch = "main" +branches = ["main", "fix/release-workflow"] upload_to_pypi = false build_command = "pip install build && python -m build" From 68e8611bf62d35a370f2273199cff0193d889436 Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:29:24 +0900 Subject: [PATCH 05/11] wip: testing release branch --- pyproject.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index db362d0..6020fbb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,10 @@ dependencies = [ [tool.semantic_release] version_variable = "early_stopping_pytorch/__init__.py:__version__" -branch = "main" -branches = ["main", "fix/release-workflow"] +branches = [ + { name = "main", channel = "latest" }, + { name = "fix/release-workflow", prerelease = true } +] upload_to_pypi = false build_command = "pip install build && python -m build" From 46d38d67ca93a93312d0ee984b3b54f4f1e4f23e Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:34:12 +0900 Subject: [PATCH 06/11] wip: toml file --- pyproject.toml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6020fbb..ef88406 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,10 @@ dependencies = [ "torch>=1.9.0" ] -[tool.semantic_release] -version_variable = "early_stopping_pytorch/__init__.py:__version__" -branches = [ - { name = "main", channel = "latest" }, - { name = "fix/release-workflow", prerelease = true } -] +[tool.semantic_release.branches] +main = {} +"fix/release-workflow" = { prerelease = true } + upload_to_pypi = false build_command = "pip install build && python -m build" From 640c3e3d153bced47108511e82cacb809e517b0b Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:34:52 +0900 Subject: [PATCH 07/11] wip: toml file --- pyproject.toml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ef88406..c954e61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,15 @@ dependencies = [ "torch>=1.9.0" ] +[tool.semantic_release] +version_variable = "early_stopping_pytorch/__init__.py:__version__" +branch = "main" +upload_to_pypi = false +build_command = "pip install build && python -m build" + [tool.semantic_release.branches] main = {} "fix/release-workflow" = { prerelease = true } -upload_to_pypi = false -build_command = "pip install build && python -m build" - [tool.semantic_release.git] tag_format = "v{version}" From 1613eecfdb95e3195ca1b817def8b6bd210ddc86 Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:37:21 +0900 Subject: [PATCH 08/11] wip: toml file --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c954e61..469c26f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,13 +17,9 @@ dependencies = [ [tool.semantic_release] version_variable = "early_stopping_pytorch/__init__.py:__version__" -branch = "main" +branch = ["main", "fix/release-workflow"] # Include your branch here upload_to_pypi = false build_command = "pip install build && python -m build" -[tool.semantic_release.branches] -main = {} -"fix/release-workflow" = { prerelease = true } - [tool.semantic_release.git] tag_format = "v{version}" From 49d2bd16114a633d314c763a79fecb06c3955503 Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:45:25 +0900 Subject: [PATCH 09/11] wip: toml file --- pyproject.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 469c26f..3baa6bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,9 +17,17 @@ dependencies = [ [tool.semantic_release] version_variable = "early_stopping_pytorch/__init__.py:__version__" -branch = ["main", "fix/release-workflow"] # Include your branch here upload_to_pypi = false build_command = "pip install build && python -m build" [tool.semantic_release.git] tag_format = "v{version}" + +[tool.semantic_release.branches.main] +match = "(main|master)" +prerelease = false + +[tool.semantic_release.branches."fix/release-workflow"] +match = "fix/release-workflow" +prerelease = true +prerelease_token = "beta" From f66ee87282ddcbb81516fec37bd87acbd2d2a92c Mon Sep 17 00:00:00 2001 From: Bjarte Mehus Sunde Date: Fri, 18 Oct 2024 16:47:21 +0900 Subject: [PATCH 10/11] wip: release --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 86447a2..f6b2b22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,4 +38,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - semantic-release publish + semantic-release publish --no-ci -vv From 9fae588d9aa270a8e6ba53449177fbab59b63a5a Mon Sep 17 00:00:00 2001 From: Bjarten Date: Fri, 18 Oct 2024 17:07:42 +0900 Subject: [PATCH 11/11] fix: update realse workflow --- .github/workflows/release.yml | 34 ++++++++++------------------------ pyproject.toml | 12 ++---------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6b2b22..f2de67e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,18 @@ -name: Create New Release +name: Semantic Release on: + push: + branches: + - main workflow_dispatch: jobs: release: - name: Create Release runs-on: ubuntu-latest + concurrency: release permissions: + id-token: write contents: write - issues: write - pull-requests: write - actions: write steps: - name: Checkout code @@ -19,23 +20,8 @@ jobs: with: fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Python Semantic Release + id: release + uses: python-semantic-release/python-semantic-release@v9.12.0 with: - python-version: '3.12' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install python-semantic-release - - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Run semantic-release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - semantic-release publish --no-ci -vv + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3baa6bb..8a95a41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,17 +17,9 @@ dependencies = [ [tool.semantic_release] version_variable = "early_stopping_pytorch/__init__.py:__version__" +branch = "main" upload_to_pypi = false build_command = "pip install build && python -m build" [tool.semantic_release.git] -tag_format = "v{version}" - -[tool.semantic_release.branches.main] -match = "(main|master)" -prerelease = false - -[tool.semantic_release.branches."fix/release-workflow"] -match = "fix/release-workflow" -prerelease = true -prerelease_token = "beta" +tag_format = "v{version}" \ No newline at end of file