From 542516d30ce1af5c7445330de941f33c17a80e82 Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sun, 5 Jan 2025 16:08:13 +0000 Subject: [PATCH 1/4] publish to pypi test --- .github/workflows/publish.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 986a677..b0928d5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -57,13 +57,13 @@ jobs: OUTPUT: CHANGELOG.md GITHUB_REPO: ${{ github.repository }} - - name: Create release - uses: softprops/action-gh-release@v2.1.0 - with: - files: dist/* - body_path: CHANGELOG.md + # - name: Create release + # uses: softprops/action-gh-release@v2.1.0 + # with: + # files: dist/* + # body_path: CHANGELOG.md - - name: Publish package - run: | - poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} - poetry publish + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@v1.12.3 + with: + repository-url: https://test.pypi.org/legacy/ From 80201c1e18286d5a51885a3b53df0cb3a1468135 Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sun, 5 Jan 2025 16:10:12 +0000 Subject: [PATCH 2/4] add permission --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b0928d5..ea5edfe 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,6 +7,7 @@ on: permissions: contents: write + id-token: write jobs: publish-package: From 473d8f77ca590e8a2e94e60fe1a86bc247842f81 Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sun, 5 Jan 2025 16:11:06 +0000 Subject: [PATCH 3/4] disable changelog pr --- .github/workflows/changelog-pr.yml | 86 +++++++++++++++--------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/changelog-pr.yml b/.github/workflows/changelog-pr.yml index 771d442..626ac46 100644 --- a/.github/workflows/changelog-pr.yml +++ b/.github/workflows/changelog-pr.yml @@ -1,50 +1,50 @@ -name: Generate Changelog +# name: Generate Changelog -on: - push: - tags: - - "v*" +# on: +# push: +# tags: +# - "v*" -permissions: - contents: write +# permissions: +# contents: write -jobs: - changelog: - name: Generate changelog - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 +# jobs: +# changelog: +# name: Generate changelog +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 - - name: Generate a changelog - uses: orhun/git-cliff-action@v4.4.2 - with: - config: cliff.toml - env: - OUTPUT: CHANGELOG.md - GITHUB_REPO: ${{ github.repository }} +# - name: Generate a changelog +# uses: orhun/git-cliff-action@v4.4.2 +# with: +# config: cliff.toml +# env: +# OUTPUT: CHANGELOG.md +# GITHUB_REPO: ${{ github.repository }} - - name: Commit - id: commit - run: | - TAG=${GITHUB_REF#refs/tags/} - echo "tag=$TAG" >> $GITHUB_OUTPUT - branch_name="$TAG-changelog" +# - name: Commit +# id: commit +# run: | +# TAG=${GITHUB_REF#refs/tags/} +# echo "tag=$TAG" >> $GITHUB_OUTPUT +# branch_name="$TAG-changelog" - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - set +e - git checkout -b "$branch_name" - git add CHANGELOG.md - git commit -m "chore: update changelog" - git push origin "$branch_name" +# git config user.name 'github-actions[bot]' +# git config user.email 'github-actions[bot]@users.noreply.github.com' +# set +e +# git checkout -b "$branch_name" +# git add CHANGELOG.md +# git commit -m "chore: update changelog" +# git push origin "$branch_name" - - name: Create Pull Request - uses: repo-sync/pull-request@v2 - with: - destination_branch: main - source_branch: ${{ steps.commit.outputs.tag }}-changelog - pr_title: "chore: update changelog for ${{ steps.commit.outputs.tag }}" - pr_body: "Automated changelog update for release ${{ steps.commit.outputs.tag }}" +# - name: Create Pull Request +# uses: repo-sync/pull-request@v2 +# with: +# destination_branch: main +# source_branch: ${{ steps.commit.outputs.tag }}-changelog +# pr_title: "chore: update changelog for ${{ steps.commit.outputs.tag }}" +# pr_body: "Automated changelog update for release ${{ steps.commit.outputs.tag }}" From 469c3de716ba3a6ae858538a73938976bf3540fd Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sun, 5 Jan 2025 16:22:00 +0000 Subject: [PATCH 4/4] use oidc for pypi publishing --- .github/workflows/changelog-pr.yml | 86 +++++++++++++++--------------- .github/workflows/publish.yml | 16 +++--- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/.github/workflows/changelog-pr.yml b/.github/workflows/changelog-pr.yml index 626ac46..771d442 100644 --- a/.github/workflows/changelog-pr.yml +++ b/.github/workflows/changelog-pr.yml @@ -1,50 +1,50 @@ -# name: Generate Changelog +name: Generate Changelog -# on: -# push: -# tags: -# - "v*" +on: + push: + tags: + - "v*" -# permissions: -# contents: write +permissions: + contents: write -# jobs: -# changelog: -# name: Generate changelog -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# with: -# fetch-depth: 0 +jobs: + changelog: + name: Generate changelog + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 -# - name: Generate a changelog -# uses: orhun/git-cliff-action@v4.4.2 -# with: -# config: cliff.toml -# env: -# OUTPUT: CHANGELOG.md -# GITHUB_REPO: ${{ github.repository }} + - name: Generate a changelog + uses: orhun/git-cliff-action@v4.4.2 + with: + config: cliff.toml + env: + OUTPUT: CHANGELOG.md + GITHUB_REPO: ${{ github.repository }} -# - name: Commit -# id: commit -# run: | -# TAG=${GITHUB_REF#refs/tags/} -# echo "tag=$TAG" >> $GITHUB_OUTPUT -# branch_name="$TAG-changelog" + - name: Commit + id: commit + run: | + TAG=${GITHUB_REF#refs/tags/} + echo "tag=$TAG" >> $GITHUB_OUTPUT + branch_name="$TAG-changelog" -# git config user.name 'github-actions[bot]' -# git config user.email 'github-actions[bot]@users.noreply.github.com' -# set +e -# git checkout -b "$branch_name" -# git add CHANGELOG.md -# git commit -m "chore: update changelog" -# git push origin "$branch_name" + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + set +e + git checkout -b "$branch_name" + git add CHANGELOG.md + git commit -m "chore: update changelog" + git push origin "$branch_name" -# - name: Create Pull Request -# uses: repo-sync/pull-request@v2 -# with: -# destination_branch: main -# source_branch: ${{ steps.commit.outputs.tag }}-changelog -# pr_title: "chore: update changelog for ${{ steps.commit.outputs.tag }}" -# pr_body: "Automated changelog update for release ${{ steps.commit.outputs.tag }}" + - name: Create Pull Request + uses: repo-sync/pull-request@v2 + with: + destination_branch: main + source_branch: ${{ steps.commit.outputs.tag }}-changelog + pr_title: "chore: update changelog for ${{ steps.commit.outputs.tag }}" + pr_body: "Automated changelog update for release ${{ steps.commit.outputs.tag }}" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ea5edfe..b46735a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -58,13 +58,13 @@ jobs: OUTPUT: CHANGELOG.md GITHUB_REPO: ${{ github.repository }} - # - name: Create release - # uses: softprops/action-gh-release@v2.1.0 - # with: - # files: dist/* - # body_path: CHANGELOG.md + - name: Create release + uses: softprops/action-gh-release@v2.1.0 + with: + files: dist/* + body_path: CHANGELOG.md - - name: Publish package distributions to TestPyPI + - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@v1.12.3 - with: - repository-url: https://test.pypi.org/legacy/ + # with: + # repository-url: https://test.pypi.org/legacy/