From 5686f23fe9fac7b8b0a47a1e3b058dc572cc2d00 Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 11 Dec 2023 11:27:19 +0100 Subject: [PATCH 1/3] fix: pypi publish --- .github/workflows/pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index daaf6dc..bde9a91 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -66,6 +66,6 @@ jobs: if: ${{ steps.release.outputs.version != '' }} run: | python -m pip install pythorhead - python .github/publish_on_lemmy.py ${{ steps.release.outputs.version }} + python .github/workflows/publish_on_lemmy.py ${{ steps.release.outputs.version }} env: LEMMY_BOT_PASSWORD: ${{ secrets.LEMMY_BOT_PASSWORD }} From f22ada479864b7ebc6b16c381f81af38f08aef26 Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 11 Dec 2023 11:32:01 +0100 Subject: [PATCH 2/3] permissions --- .github/workflows/pypi.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index bde9a91..5122334 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,5 +1,9 @@ name: Pythonseer build and publish +permissions: + contents: write + pull-requests: read + on: push: branches: From 90d831e415d06324651b9549b2d438ad48d4107b Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 11 Dec 2023 11:44:55 +0100 Subject: [PATCH 3/3] tag --- .github/workflows/pypi.yml | 6 +---- .github/workflows/release_gen.yml | 43 +++++++++++++++++++++---------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 5122334..8e7b221 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,8 +1,4 @@ -name: Pythonseer build and publish - -permissions: - contents: write - pull-requests: read +name: Pythonseer build and publish via label on: push: diff --git a/.github/workflows/release_gen.yml b/.github/workflows/release_gen.yml index 41603a7..aafe0cb 100644 --- a/.github/workflows/release_gen.yml +++ b/.github/workflows/release_gen.yml @@ -1,4 +1,4 @@ -name: Release +name: Pythonseer build and publish via tag on: push: @@ -6,16 +6,31 @@ on: - "v[0-9]+.[0-9]+.[0-9]+" jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - uses: BobAnkh/auto-generate-changelog@v1.2.5 - with: - ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}} - - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - generateReleaseNotes: true + build-n-publish: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: "✔️ Checkout" + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: "✏️ Generate release changelog" + uses: BobAnkh/auto-generate-changelog@v1.2.5 + with: + ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}} + - uses: ncipollo/release-action@v1 + with: + allowUpdates: true + generateReleaseNotes: true + - name: "🛠 Install and publish with poetry" + run: | + make setup + poetry build + poetry publish + - name: "🤖 Announce on lemmy.dbzer0.com" + run: | + python -m pip install pythorhead + python .github/workflows/publish_on_lemmy.py ${{ env.RELEASE_VERSION }} + env: + LEMMY_BOT_PASSWORD: ${{ secrets.LEMMY_BOT_PASSWORD }}