Debian Codegraph @

.github/workflows/deploy.yml

raw symbols SCIP
1 name: deploy
2
3 on:
4 workflow_dispatch:
5 inputs:
6 version:
7 description: 'Release version'
8 required: true
9 default: '1.2.3'
10
11 jobs:
12
13 package:
14 runs-on: ubuntu-latest
15 # Required by attest-build-provenance-github.
16 permissions:
17 id-token: write
18 attestations: write
19 env:
20 SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.event.inputs.version }}
21
22 steps:
23 - uses: actions/checkout@v4
24
25 - name: Build and Check Package
26 uses: hynek/[email protected]
27 with:
28 attest-build-provenance-github: 'true'
29
30
31 deploy:
32 needs: package
33 runs-on: ubuntu-latest
34 environment: deploy
35 permissions:
36 id-token: write # For PyPI trusted publishers.
37 contents: write # For tag and release notes.
38
39 steps:
40 - uses: actions/checkout@v4
41
42 - name: Download Package
43 uses: actions/download-artifact@v4
44 with:
45 name: Packages
46 path: dist
47
48 - name: Publish package to PyPI
49 uses: pypa/[email protected]
50 with:
51 attestations: true
52
53 - name: Push tag
54 run: |
55 git config user.name "pytest bot"
56 git config user.email "[email protected]"
57 git tag --annotate --message=v${{ github.event.inputs.version }} v${{ github.event.inputs.version }} ${{ github.sha }}
58 git push origin v${{ github.event.inputs.version }}
59
60 - name: GitHub Release
61 uses: softprops/action-gh-release@v2
62 with:
63 body_path: scripts/latest-release-notes.md
64 files: dist/*
65 tag_name: v${{ github.event.inputs.version }}