Debian Codegraph @

.github/workflows/publish.yaml

raw
1 name: Publish
2 on:
3 push:
4 tags:
5 - '*'
6 jobs:
7 build:
8 runs-on: ubuntu-latest
9 permissions:
10 contents: read
11 outputs:
12 artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
13 steps:
14 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
15 - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
16 with:
17 python-version-file: pyproject.toml
18 # Use the commit date instead of the current date during the build.
19 - run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
20 - name: Create dist
21 run: |
22 python -m pip install -U pip
23 pip install tox
24 tox -e makedist
25 - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
26 id: upload-artifact
27 with:
28 name: dist
29 path: dist/
30 if-no-files-found: error
31 create-release:
32 needs: [build]
33 runs-on: ubuntu-latest
34 permissions:
35 contents: write
36 steps:
37 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
38 with:
39 artifact-ids: ${{ needs.build.outputs.artifact-id }}
40 path: dist/
41 - name: create release
42 run: gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} dist/*
43 env:
44 GH_TOKEN: ${{ github.token }}
45 publish-pypi:
46 needs: [build]
47 # Wait for approval before attempting to upload to PyPI. This allows reviewing the
48 # files in the draft release.
49 environment:
50 name: publish
51 url: https://pypi.org/project/Flask-Security/${{ github.ref_name }}
52 runs-on: ubuntu-latest
53 permissions:
54 id-token: write
55 steps:
56 - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
57 with:
58 artifact-ids: ${{ needs.build.outputs.artifact-id }}
59 path: dist/
60 - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
61 with:
62 packages-dir: dist/