From 2e9fbd4d3988b8c847a97b25b9db671eac501eba Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 15:04:16 -0800 Subject: [PATCH 1/7] fix template format --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c3e399f..88a1ba1c2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,6 +70,8 @@ jobs: needs: build runs-on: ubuntu-latest environment: release + permissions: + contents: write # grants permission to create a release on github steps: - uses: actions/checkout@v4 @@ -109,6 +111,6 @@ jobs: text: | Actor: `${{ github.triggering_actor }}` Author: `${{ github.event.head_commit.author.username }}` - ${{ format('Commit: <{0}/{1}/commit/{2}|{1}@{2[:7]}>', github.server_url, github.repository, github.sha) || ''}} + ${{ format('Commit: <{0}/{1}/commit/{2}|{1}@{2}>', github.server_url, github.repository, github.sha) || ''}} ${{ format('Description: `{0}`', github.event.head_commit.message) || ''}} View <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GHA logs> From b81d76ba65fb526dc9bd68e7763f4ac69d6bc2d4 Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 15:05:01 -0800 Subject: [PATCH 2/7] test release --- .github/workflows/release.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88a1ba1c2..936e6df91 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref || github.ref }} + ref: v0.5.24 - name: Setup environment uses: ./.github/actions/setup-environment @@ -85,11 +85,11 @@ jobs: merge-multiple: true pattern: wheels-* - - name: Release PyPI - run: | - export UV_PUBLISH_PASSWORD="${{ secrets.PYPI_TOKEN }}" - export UV_PUBLISH_USERNAME="__token__" - uv publish --publish-url https://upload.pypi.org/legacy/ + # - name: Release PyPI + # run: | + # export UV_PUBLISH_PASSWORD="${{ secrets.PYPI_TOKEN }}" + # export UV_PUBLISH_USERNAME="__token__" + # uv publish --publish-url https://upload.pypi.org/legacy/ - name: Make github release id: github-release From 88b11cd81619a16596aa1e0d1df93811f46c338b Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 16:17:32 -0800 Subject: [PATCH 3/7] test release --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 936e6df91..e08e10e3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,7 +66,6 @@ jobs: path: ./wheelhouse/*.whl release: - if: startsWith(github.ref, 'refs/tags/') needs: build runs-on: ubuntu-latest environment: release From c1d02103e352f3baccacd2a30a417aafb8594a19 Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 16:31:49 -0800 Subject: [PATCH 4/7] try again with token --- .github/workflows/release.yml | 56 +++-------------------------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e08e10e3d..6b23e26bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,64 +15,15 @@ permissions: contents: read jobs: - build: - name: Build 3.${{ matrix.python }} ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ - ubuntu-latest, - ubuntu-24.04-arm, - macos-latest, - ] - python: [ - 12, - 13, - ] - - steps: - - name: Github context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: v0.5.24 - - - name: Setup environment - uses: ./.github/actions/setup-environment - with: - python-version: 3.${{ matrix.python }} - - - name: Fetch tags - run: | - git branch - git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - # TODO: add cbuildwheel cache - - name: Build wheel - uses: pypa/cibuildwheel@v2.22.0 - env: - HATCH_BUILD_HOOKS_ENABLE: true - CIBW_BUILD: "*cp3${{ matrix.python }}*" - CIBW_SKIP: '{*i686*,*musllinux*}' - - - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }}-3.${{ matrix.python }} - path: ./wheelhouse/*.whl - release: - needs: build runs-on: ubuntu-latest environment: release permissions: contents: write # grants permission to create a release on github steps: - uses: actions/checkout@v4 + with: + ref: v0.5.24 - name: Setup backend uses: ./.github/actions/setup-environment @@ -94,6 +45,7 @@ jobs: id: github-release uses: softprops/action-gh-release@v2 with: + tag_name: v0.5.24 files: dist/* fail_on_unmatched_files: true generate_release_notes: true @@ -105,7 +57,7 @@ jobs: token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | username: ${{ job.status == 'success' && format('Released <{0}|{1}>', steps.github-release.outputs.url, github.ref_name) || format('Failed to release {0}', github.ref_name) }} - channel: "#release" + channel: "#christine-test" icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" text: | Actor: `${{ github.triggering_actor }}` From 9e39b0ffdd58326ce50d8f90e3bc70686fa638a9 Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 16:39:58 -0800 Subject: [PATCH 5/7] add back full build --- .github/workflows/release.yml | 56 ++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6b23e26bb..e08e10e3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,15 +15,64 @@ permissions: contents: read jobs: + build: + name: Build 3.${{ matrix.python }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ + ubuntu-latest, + ubuntu-24.04-arm, + macos-latest, + ] + python: [ + 12, + 13, + ] + + steps: + - name: Github context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: v0.5.24 + + - name: Setup environment + uses: ./.github/actions/setup-environment + with: + python-version: 3.${{ matrix.python }} + + - name: Fetch tags + run: | + git branch + git fetch --depth=1 origin +refs/tags/*:refs/tags/* + + # TODO: add cbuildwheel cache + - name: Build wheel + uses: pypa/cibuildwheel@v2.22.0 + env: + HATCH_BUILD_HOOKS_ENABLE: true + CIBW_BUILD: "*cp3${{ matrix.python }}*" + CIBW_SKIP: '{*i686*,*musllinux*}' + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.os }}-3.${{ matrix.python }} + path: ./wheelhouse/*.whl + release: + needs: build runs-on: ubuntu-latest environment: release permissions: contents: write # grants permission to create a release on github steps: - uses: actions/checkout@v4 - with: - ref: v0.5.24 - name: Setup backend uses: ./.github/actions/setup-environment @@ -45,7 +94,6 @@ jobs: id: github-release uses: softprops/action-gh-release@v2 with: - tag_name: v0.5.24 files: dist/* fail_on_unmatched_files: true generate_release_notes: true @@ -57,7 +105,7 @@ jobs: token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | username: ${{ job.status == 'success' && format('Released <{0}|{1}>', steps.github-release.outputs.url, github.ref_name) || format('Failed to release {0}', github.ref_name) }} - channel: "#christine-test" + channel: "#release" icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" text: | Actor: `${{ github.triggering_actor }}` From baab89a15c10c36d18f43466c50841c44649376c Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 16:46:04 -0800 Subject: [PATCH 6/7] set tag name --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e08e10e3d..9b8d5d79c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -94,6 +94,7 @@ jobs: id: github-release uses: softprops/action-gh-release@v2 with: + tag_name: v0.5.24 files: dist/* fail_on_unmatched_files: true generate_release_notes: true @@ -105,7 +106,7 @@ jobs: token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | username: ${{ job.status == 'success' && format('Released <{0}|{1}>', steps.github-release.outputs.url, github.ref_name) || format('Failed to release {0}', github.ref_name) }} - channel: "#release" + channel: "#christine-test" icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" text: | Actor: `${{ github.triggering_actor }}` From 29555a7981327ec6a404d10761ee308dbdf54b12 Mon Sep 17 00:00:00 2001 From: Christine Wang Date: Wed, 5 Feb 2025 16:54:41 -0800 Subject: [PATCH 7/7] revert testing changes --- .github/workflows/release.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b8d5d79c..8819ac368 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: v0.5.24 + ref: ${{ github.event.pull_request.head.ref || github.ref }} - name: Setup environment uses: ./.github/actions/setup-environment @@ -66,6 +66,7 @@ jobs: path: ./wheelhouse/*.whl release: + if: startsWith(github.ref, 'refs/tags/') needs: build runs-on: ubuntu-latest environment: release @@ -84,17 +85,16 @@ jobs: merge-multiple: true pattern: wheels-* - # - name: Release PyPI - # run: | - # export UV_PUBLISH_PASSWORD="${{ secrets.PYPI_TOKEN }}" - # export UV_PUBLISH_USERNAME="__token__" - # uv publish --publish-url https://upload.pypi.org/legacy/ + - name: Release PyPI + run: | + export UV_PUBLISH_PASSWORD="${{ secrets.PYPI_TOKEN }}" + export UV_PUBLISH_USERNAME="__token__" + uv publish --publish-url https://upload.pypi.org/legacy/ - name: Make github release id: github-release uses: softprops/action-gh-release@v2 with: - tag_name: v0.5.24 files: dist/* fail_on_unmatched_files: true generate_release_notes: true @@ -105,8 +105,8 @@ jobs: method: chat.postMessage token: ${{ secrets.SLACK_BOT_TOKEN }} payload: | - username: ${{ job.status == 'success' && format('Released <{0}|{1}>', steps.github-release.outputs.url, github.ref_name) || format('Failed to release {0}', github.ref_name) }} - channel: "#christine-test" + username: ${{ job.status == 'success' && format('Released {0}', github.ref_name) || format('Failed to release {0}', github.ref_name) }} + channel: "#release" icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}" text: | Actor: `${{ github.triggering_actor }}`