|
1 | 1 | name: Publish |
2 | 2 | on: |
3 | 3 | push: |
4 | | - tags: |
5 | | - - '*' |
| 4 | + tags: ['*'] |
6 | 5 | jobs: |
7 | 6 | build: |
8 | 7 | runs-on: ubuntu-latest |
9 | | - outputs: |
10 | | - hash: ${{ steps.hash.outputs.hash }} |
11 | 8 | steps: |
12 | 9 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
13 | | - - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 |
| 10 | + - uses: astral-sh/setup-uv@f0ec1fc3b38f5e7cd731bb6ce540c5af426746bb # v6.1.0 |
14 | 11 | with: |
15 | | - python-version: '3.x' |
16 | | - cache: pip |
17 | | - cache-dependency-path: requirements*/*.txt |
18 | | - - run: pip install -r requirements/build.txt |
19 | | - # Use the commit date instead of the current date during the build. |
| 12 | + enable-cache: true |
| 13 | + prune-cache: false |
| 14 | + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 |
| 15 | + with: |
| 16 | + python-version-file: pyproject.toml |
20 | 17 | - run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV |
21 | | - - run: python -m build |
22 | | - # Generate hashes used for provenance. |
23 | | - - name: generate hash |
24 | | - id: hash |
25 | | - run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT |
26 | | - - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 |
| 18 | + - run: uv build |
| 19 | + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
27 | 20 | with: |
28 | 21 | path: ./dist |
29 | | - provenance: |
30 | | - needs: [build] |
31 | | - permissions: |
32 | | - actions: read |
33 | | - id-token: write |
34 | | - contents: write |
35 | | - # Can't pin with hash due to how this workflow works. |
36 | | - uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] |
37 | | - with: |
38 | | - base64-subjects: ${{ needs.build.outputs.hash }} |
39 | 22 | create-release: |
40 | | - # Upload the sdist, wheels, and provenance to a GitHub release. They remain |
41 | | - # available as build artifacts for a while as well. |
42 | | - needs: [provenance] |
| 23 | + needs: [build] |
43 | 24 | runs-on: ubuntu-latest |
44 | 25 | permissions: |
45 | 26 | contents: write |
46 | 27 | steps: |
47 | | - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
| 28 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
48 | 29 | - name: create release |
49 | | - run: > |
50 | | - gh release create --draft --repo ${{ github.repository }} |
51 | | - ${{ github.ref_name }} |
52 | | - *.intoto.jsonl/* artifact/* |
| 30 | + run: gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} artifact/* |
53 | 31 | env: |
54 | 32 | GH_TOKEN: ${{ github.token }} |
55 | 33 | publish-pypi: |
56 | | - needs: [provenance] |
57 | | - # Wait for approval before attempting to upload to PyPI. This allows reviewing the |
58 | | - # files in the draft release. |
| 34 | + needs: [build] |
59 | 35 | environment: |
60 | 36 | name: publish |
61 | 37 | url: https://pypi.org/project/Quart/${{ github.ref_name }} |
62 | 38 | runs-on: ubuntu-latest |
63 | 39 | permissions: |
64 | 40 | id-token: write |
65 | 41 | steps: |
66 | | - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 |
67 | | - - uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2 |
| 42 | + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 43 | + - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 |
68 | 44 | with: |
69 | 45 | packages-dir: artifact/ |
0 commit comments