-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 1.52 KB
/
publish.yml
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
---
name: Publish
run-name: Publish ${{ github.ref_name }}
on:
push:
tags:
- v*
jobs:
build:
name: Build
uses: ./.github/workflows/_build.yml
with:
upload_artifact: 'true'
release:
name: GitHub Releases
runs-on: ubuntu-latest
timeout-minutes: 30
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: dist/
- name: Generate release notes
id: changelog
run: |
mkdir tmp
outfile=tmp/changelog.txt
echo "outfile=${outfile}" >> $GITHUB_OUTPUT
npx standard-changelog@^5.0.0 --release-count 2 --infile $outfile.tmp --outfile $outfile.tmp
sed '1,3d' $outfile.tmp > $outfile
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GH_TOKEN }}
fail_on_unmatched_files: true
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
files: dist/*
body_path: ${{ github.workspace }}/${{ steps.changelog.outputs.outfile }}
pypi:
name: PyPI
uses: ./.github/workflows/_publish.yml
needs: build
with:
artifact_name: ${{ needs.build.outputs.artifact_name }}
secrets:
registry_token: ${{ secrets.PYPI_API_TOKEN }}