-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (43 loc) · 1.49 KB
/
release.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
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
test:
uses: "./.github/workflows/main.yml"
publish-package:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Version number
run: |
export RELEASE_VERSION="${GITHUB_REF#refs/*/}" # Generates output of the 'v0.12.9' format
export RELEASE_VERSION="${RELEASE_VERSION:1}" # `:}"` -- remove the 'v' prefix
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
echo "Release version: ${RELEASE_VERSION}"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
- name: Build packages
run: |
pip install build
python -m build --outdir dist/
# XXX: Generate legacy names (TODO: fix version check code in the plugin)
cd dist && for l in $(ls -1 .); do cp $l $(echo $l | sed -e "s/-${RELEASE_VERSION}/-v${RELEASE_VERSION}/" ); done && cd ..
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*.whl
dist/*.tar.gz
dist/*.zip
prerelease: ${{ contains(env.RELEASE_VERSION, 'dev') || contains(env.RELEASE_VERSION, 'pre') }}
name: ${{env.RELEASE_VERSION}}
tag_name: ${{env.RELEASE_VERSION}}
- name: Update stable-latest
run: |
git tag -f stable-latest
git push --force origin stable-latest