Update GitHub Actions workflow for artifact handling

This commit is contained in:
Grant Birkinbine 2025-08-06 21:44:28 -07:00 committed by David Lord
parent 55c6255657
commit 4dd52ca9c7
No known key found for this signature in database
GPG key ID: 43368A7AA8CC5926

View file

@ -5,8 +5,12 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs:
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
steps: steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0 - uses: astral-sh/setup-uv@d9e0f98d3fc6adb07d1e3d37f3043649ddad06a1 # v6.5.0
with: with:
enable-cache: true enable-cache: true
@ -17,8 +21,11 @@ jobs:
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV - run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
- run: uv build - run: uv build
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
id: upload-artifact
with: with:
path: ./dist name: dist
path: dist/
if-no-files-found: error
create-release: create-release:
needs: [build] needs: [build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -26,8 +33,11 @@ jobs:
contents: write contents: write
steps: steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
artifact-ids: ${{ needs.build.outputs.artifact-id }}
path: dist/
- name: create release - name: create release
run: gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} artifact/* run: gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} dist/*
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
publish-pypi: publish-pypi:
@ -40,6 +50,9 @@ jobs:
id-token: write id-token: write
steps: steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
artifact-ids: ${{ needs.build.outputs.artifact-id }}
path: dist/
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with: with:
packages-dir: artifact/ packages-dir: "dist/"