From b221ec99a8b4096b0bf7e9baee545b9f7cf7c94e Mon Sep 17 00:00:00 2001 From: Ali Zahedigol Date: Thu, 28 Mar 2024 11:40:38 +0200 Subject: [PATCH 1/5] fix!: echo new tag BREAKING CHANGE: add github action --- .github/workflows/semantic.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/semantic.yaml b/.github/workflows/semantic.yaml index aef4e8c..566846a 100644 --- a/.github/workflows/semantic.yaml +++ b/.github/workflows/semantic.yaml @@ -41,7 +41,9 @@ jobs: echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV - name: Update package version - run: sed -i "s/__version__ = \"1.0.0\"/__version__ = \"$NEW_TAG\"/g" azbankgateways/__init__.py + run: | + echo "$NEW_TAG" + sed -i "s/__version__ = \"1.0.0\"/__version__ = \"$NEW_TAG\"/g" azbankgateways/__init__.py - name: Build package uses: actions/setup-python@v4 with: From 26d6ce693cb2781677e66bd198f9ff9ee96aa63c Mon Sep 17 00:00:00 2001 From: Ali Zahedigol Date: Thu, 28 Mar 2024 11:53:03 +0200 Subject: [PATCH 2/5] fix!: trust github action --- .github/workflows/{semantic.yaml => release.yaml} | 2 -- MANIFEST.in | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) rename .github/workflows/{semantic.yaml => release.yaml} (96%) diff --git a/.github/workflows/semantic.yaml b/.github/workflows/release.yaml similarity index 96% rename from .github/workflows/semantic.yaml rename to .github/workflows/release.yaml index 566846a..e0a582b 100644 --- a/.github/workflows/semantic.yaml +++ b/.github/workflows/release.yaml @@ -55,5 +55,3 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 - with: - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/MANIFEST.in b/MANIFEST.in index 8da6eb0..12ef2a3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,4 @@ include LICENSE.md include README.md recursive-include azbankgateways * recursive-include docs * +prune node_modules From 5f03080905066cda10e63bb863c3d003d95759c9 Mon Sep 17 00:00:00 2001 From: Ali Zahedigol Date: Thu, 28 Mar 2024 11:57:14 +0200 Subject: [PATCH 3/5] fix: add permission write for trusted publishing --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e0a582b..830cf6c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,6 +14,8 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.set_output.outputs.version }} + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Checkout Code uses: actions/checkout@v3 From 41fdcdb2b4d992887bd4e030949bed3911daa3eb Mon Sep 17 00:00:00 2001 From: Ali Zahedigol Date: Thu, 28 Mar 2024 12:16:38 +0200 Subject: [PATCH 4/5] fix: add hotfix for pypi publish --- .github/workflows/release.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 830cf6c..9ba056c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,8 +14,6 @@ jobs: runs-on: ubuntu-latest outputs: version: ${{ steps.set_output.outputs.version }} - permissions: - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Checkout Code uses: actions/checkout@v3 @@ -46,6 +44,16 @@ jobs: run: | echo "$NEW_TAG" sed -i "s/__version__ = \"1.0.0\"/__version__ = \"$NEW_TAG\"/g" azbankgateways/__init__.py + + pypi-publish: + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/az-iranian-bank-gateways/ + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: - name: Build package uses: actions/setup-python@v4 with: @@ -54,6 +62,5 @@ jobs: run: python -m pip install build - name: Build dist run: python -m build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.14 + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From c9ea612293f08c8321b898bcc9cb78a817c36e0f Mon Sep 17 00:00:00 2001 From: Ali Zahedigol Date: Thu, 28 Mar 2024 15:07:31 +0200 Subject: [PATCH 5/5] fix: remove unused environment --- .github/workflows/release.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9ba056c..83b635f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,9 +48,6 @@ jobs: pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/az-iranian-bank-gateways/ permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: