-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.4 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
45
46
47
48
49
50
51
52
53
54
name: release
on:
push:
branches:
- master
tags:
- '*.*.*'
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
DEST_FOLDER: dist/
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
# https://stackoverflow.com/questions/66349002/get-latest-tag-git-describe-tags-when-repo-is-cloned-with-depth-1
- name: Get latest tag
run: |
git fetch -a
echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
- name: Install py39
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: pip
cache-dependency-path: 'requirements/*.pip'
- name: build
shell: bash
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
python -m pip install --upgrade -r requirements/pip-tools.pip
echo "python igor.py build_next $RELEASE_VERSION"
python igor.py build_next "$RELEASE_VERSION"
- name: Release PyPI
shell: bash
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
pip install --upgrade twine
twine upload ${{ env.DEST_FOLDER }}*
- name: Release GitHub
uses: softprops/action-gh-release@v1
with:
files: ${{ env.DEST_FOLDER }}*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}