From fae103cbedd28c50e6c81cd3ad922eb96978b009 Mon Sep 17 00:00:00 2001 From: Jason Lam Date: Sun, 2 Jun 2024 15:28:22 +0800 Subject: [PATCH 1/5] Add quotes to the title in release action --- .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 31f41a8436..7f0d733740 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT" else - TITLE=${{ github.event.pull_request.title }} + TITLE="${{ github.event.pull_request.title }}" echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT" fi - name: Bump version and push tag From 6ecde34ae4243c140390847a906f1e9115d9ad25 Mon Sep 17 00:00:00 2001 From: Jason Lam Date: Sun, 2 Jun 2024 15:36:35 +0800 Subject: [PATCH 2/5] Fix tag_name for upload_zipapp action --- .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 7f0d733740..ea86d56750 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -104,4 +104,4 @@ jobs: uses: softprops/action-gh-release@v2 with: files: pipx.pyz - tag_name: "${{ needs.create-release.outputs.release-tag }}" + tag_name: "${{ needs.create-tag.outputs.release-tag }}" From 9498b7b64372f539d7c9ef3c1c40d66e05be33b3 Mon Sep 17 00:00:00 2001 From: Jason Lam Date: Sun, 2 Jun 2024 15:44:06 +0800 Subject: [PATCH 3/5] Update release.yml --- .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 ea86d56750..d12b42aba5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,7 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release - needs: create-release + needs: create-tag runs-on: ubuntu-latest permissions: contents: write From d92afd439eea126d46063e9f080b0639a0009708 Mon Sep 17 00:00:00 2001 From: Jason Lam Date: Mon, 3 Jun 2024 17:31:29 +0800 Subject: [PATCH 4/5] Generate zipapp directly before uploading to release --- .github/workflows/release.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d12b42aba5..79f15c035d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,7 +68,7 @@ jobs: cache: "pip" - name: Install nox run: pip install nox - - name: Build sdist and wheel + - name: Build sdist and wheel run: nox --error-on-missing-interpreters --non-interactive --session build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 @@ -94,12 +94,19 @@ jobs: permissions: contents: write steps: - - uses: dawidd6/action-download-artifact@v3 + - name: Checkout ${{ needs.create-tag.outputs.release-tag }} + uses: actions/checkout@v4 + with: + ref: "${{ needs.create-tag.outputs.release-tag }}" + - name: Set up Python ${{ env.default-python }} + uses: actions/setup-python@v5 with: - name: pipx.pyz - workflow: tests.yml - workflow_conclusion: success - pr: ${{ github.event.pull_request.number }} + python-version: ${{ env.default-python }} + cache: "pip" + - name: Install nox + run: pip install nox + - name: Build zipapp + run: nox --error-on-missing-interpreters --non-interactive --session zipapp - name: Upload to release uses: softprops/action-gh-release@v2 with: From f92ae1c3a8ab993bf44baaecac6ab600c3147687 Mon Sep 17 00:00:00 2001 From: Jason Lam Date: Mon, 3 Jun 2024 20:33:40 +0800 Subject: [PATCH 5/5] Update .github/workflows/release.yml Co-authored-by: chrysle <96722107+chrysle@users.noreply.github.com> --- .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 79f15c035d..d814f86a33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,7 @@ jobs: upload-zipapp: name: Upload zipapp to GitHub Release - needs: create-tag + needs: [create-release, create-tag] runs-on: ubuntu-latest permissions: contents: write