-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.83 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
56
57
58
name: Publish Python Package
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: false
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
publish_pypi:
name: Publish to PyPi
runs-on: ubuntu-20.04
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: write
environment:
name: pypi
url: https://pypi.org/p/pyflasc
steps:
- name: Extract version
id: version
run: |
TAG=${{ github.ref }}
VERSION=${TAG#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Download wheels and sdist
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: Wheels.yml
workflow_conclusion: success
branch: main
path: .
- name: Move files to dist
run: |
mkdir dist
mv sdist/* dist/
mv wheels/* dist/
if [[ ! -f dist/pyflasc-${{ steps.version.outputs.version }}.tar.gz ]] ; then exit 1; fi
- name: Create Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create -R vda-lab/pyflasc -t "Version ${{ steps.version.outputs.version }}" -n "**Full Changelog**: https://github.com/vda-lab/pyflasc/commits/${{ steps.version.outputs.tag }}" "${{ steps.version.outputs.tag }}" dist/*.whl dist/*.tar.gz
- name: Publish package to (Test)PyPI
uses: pypa/[email protected]
# Comment lines below to publish to PyPi instead of test PyPi
# with:
# repository-url: https://test.pypi.org/legacy/