Debian Codegraph @

.github/workflows/publish-too.yaml

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