Repository navigation
63 lines (57 loc) · 1.63 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (57 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Release
# make release: writes cli_progress/VERSION, commits, tags (e.g. 3.0.1) and pushes the tag.
on:
push:
tags: ["[0-9]+.[0-9]+.[0-9]+*"]
workflow_dispatch:
permissions:
contents: read
jobs:
checks:
uses: ./.github/workflows/main.yml
verify-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: The tag is the version in cli_progress/VERSION
if: github.ref_type == 'tag'
run: |
version="$(tr -d '[:space:]' < cli_progress/VERSION)"
if [ "$version" != "$GITHUB_REF_NAME" ]; then
echo "::error::tag $GITHUB_REF_NAME but cli_progress/VERSION is $version"
exit 1
fi
publish:
needs: [checks, verify-tag]
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
environment: pypi
steps:
- uses: actions/download-artifact@v4 # the wheel the checks built and ran
with:
name: dist
path: dist/
- uses: astral-sh/setup-uv@v6
- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: uv publish
github-release:
needs: publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # the commits since the previous tag
- uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Release notes
run: .github/release_message.sh > release_message.md
- uses: softprops/action-gh-release@v2
with:
body_path: release_message.md
files: dist/*