| 1 |
name: Publish |
| 2 |
on: |
| 3 |
push: |
| 4 |
tags: |
| 5 |
- '*' |
| 6 |
jobs: |
| 7 |
build: |
| 8 |
runs-on: ubuntu-latest |
| 9 |
steps: |
| 10 |
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd |
| 11 |
- uses: astral-sh/setup-uv@v7 |
| 12 |
with: |
| 13 |
enable-cache: true |
| 14 |
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 |
| 15 |
with: |
| 16 |
python-version: '3.x' |
| 17 |
|
| 18 |
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV |
| 19 |
- run: uv build |
| 20 |
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f |
| 21 |
with: |
| 22 |
path: ./dist |
| 23 |
create-release: |
| 24 |
needs: [build] |
| 25 |
runs-on: ubuntu-latest |
| 26 |
permissions: |
| 27 |
contents: write |
| 28 |
steps: |
| 29 |
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c |
| 30 |
- name: create release |
| 31 |
run: > |
| 32 |
gh release create --draft --repo ${{ github.repository }} |
| 33 |
${{ github.ref_name }} artifact/* |
| 34 |
env: |
| 35 |
GH_TOKEN: ${{ github.token }} |
| 36 |
publish-pypi: |
| 37 |
needs: [build] |
| 38 |
|
| 39 |
|
| 40 |
environment: |
| 41 |
name: publish |
| 42 |
url: https://pypi.org/project/flask-wtf/${{ github.ref_name }} |
| 43 |
runs-on: ubuntu-latest |
| 44 |
permissions: |
| 45 |
id-token: write |
| 46 |
steps: |
| 47 |
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c |
| 48 |
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e |
| 49 |
with: |
| 50 |
repository-url: https://test.pypi.org/legacy/ |
| 51 |
packages-dir: artifact/ |
| 52 |
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e |
| 53 |
with: |
| 54 |
packages-dir: artifact/ |