forked from orbit-oss/flask
45 lines
1.5 KiB
YAML
45 lines
1.5 KiB
YAML
name: Publish
|
|
on:
|
|
push:
|
|
tags: ['*']
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
|
|
with:
|
|
enable-cache: true
|
|
prune-cache: false
|
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
with:
|
|
python-version-file: pyproject.toml
|
|
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
|
|
- run: uv build
|
|
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
path: ./dist
|
|
create-release:
|
|
needs: [build]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
- name: create release
|
|
run: gh release create --draft --repo ${{ github.repository }} ${{ github.ref_name }} artifact/*
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
publish-pypi:
|
|
needs: [build]
|
|
environment:
|
|
name: publish
|
|
url: https://pypi.org/project/Flask/${{ github.ref_name }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
|
|
with:
|
|
packages-dir: artifact/
|