From a1af4413eed8fadeeeedbd65e2c8b751d536c5ac Mon Sep 17 00:00:00 2001 From: Konboi Date: Tue, 4 Nov 2025 10:02:29 +0900 Subject: [PATCH 1/3] format yaml --- .github/workflows/python-publish.yml | 80 ++++++++++++++-------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 6fe7b6dc6..1d81732b5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -22,11 +22,11 @@ jobs: outputs: tag: ${{ steps.run-tagpr.outputs.tag }} steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - id: run-tagpr - uses: Songmu/tagpr@7191605433b03e11b313dbbc0efb80185170de4b # v1.9.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - id: run-tagpr + uses: Songmu/tagpr@7191605433b03e11b313dbbc0efb80185170de4b # v1.9.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} pypi: needs: tagpr @@ -35,41 +35,41 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - # build and publish package using GitHub Actions workflow - # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ - - name: Install pypa/build - run: >- - python -m - pip install - build - --user - - name: Build a binary wheel and a source tarball - run: >- - python -m - build - --sdist - --wheel - --outdir dist/ - . - # actual publish - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - - name: Actions for Discord - uses: Ilshidur/action-discord@0.3.2 - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} - with: - args: 'Launchable CLI ${{ needs.tagpr.outputs.tag }} is released! https://github.com/cloudbees-oss/smart-tests-cli/releases/tag/${{ needs.tagpr.outputs.tag }}' + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + # build and publish package using GitHub Actions workflow + # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + # actual publish + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + - name: Actions for Discord + uses: Ilshidur/action-discord@0.3.2 + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + with: + args: "Launchable CLI ${{ needs.tagpr.outputs.tag }} is released! https://github.com/cloudbees-oss/smart-tests-cli/releases/tag/${{ needs.tagpr.outputs.tag }}" docker: name: Push Docker image to Docker Hub From e8727ce45acdf71acc622452b03e0e4be06a00e9 Mon Sep 17 00:00:00 2001 From: Konboi Date: Tue, 4 Nov 2025 10:18:12 +0900 Subject: [PATCH 2/3] we'll use tagpr for v2 release thus stop using tagpr on v1 branch --- .github/workflows/python-publish.yml | 35 +++++----------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1d81732b5..fe05823e6 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -5,35 +5,16 @@ name: Upload Python Package on: workflow_dispatch: - push: - branches: - - v1 + release: + types: [published] env: IMAGE_NAME: cloudbees/launchable jobs: - tagpr: - permissions: - actions: write - contents: write - pull-requests: write - runs-on: ubuntu-latest - outputs: - tag: ${{ steps.run-tagpr.outputs.tag }} - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - id: run-tagpr - uses: Songmu/tagpr@7191605433b03e11b313dbbc0efb80185170de4b # v1.9.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pypi: - needs: tagpr - if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch' - + if: github.event_name != 'release' || startsWith(github.event.release.tag_name, 'v1') runs-on: ubuntu-22.04 - steps: - uses: actions/checkout@v4 with: @@ -69,15 +50,11 @@ jobs: env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} with: - args: "Launchable CLI ${{ needs.tagpr.outputs.tag }} is released! https://github.com/cloudbees-oss/smart-tests-cli/releases/tag/${{ needs.tagpr.outputs.tag }}" - + args: "Launchable CLI ${{ github.event.release.tag_name }} is released! ${{ github.event.release.html_url }}" docker: + if: github.event_name != 'release' || startsWith(github.event.release.tag_name, 'v1') name: Push Docker image to Docker Hub - needs: tagpr - if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-22.04 - permissions: packages: write contents: read @@ -104,7 +81,7 @@ jobs: file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true - tags: ${{ env.IMAGE_NAME }}:${{ needs.tagpr.outputs.tag }} + tags: ${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }} - name: Generate artifact attestation uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 From bc4e2888d92507cc4d874ba370163894b5716df6 Mon Sep 17 00:00:00 2001 From: Konboi Date: Tue, 4 Nov 2025 10:22:47 +0900 Subject: [PATCH 3/3] update doc for v1 release --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 820b3efce..d613e0d4c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,16 @@ pipenv install --dev some-what-module # How to release -Create new release on Github, then Github Actions automatically uploads the +1. Create a new tag for the next release locally + +```sh +git checkout v1 +git pull +git tag v1.xx.yy +git push origin --tags +``` + +2. Create new release on Github, then Github Actions automatically uploads the module to PyPI. ## How to update launchable/jar/exe_deploy.jar