-
Notifications
You must be signed in to change notification settings - Fork 38
102 lines (89 loc) · 2.69 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Publish
on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
call-test-workflow:
uses: BlueBrain/eFEL/.github/workflows/test.yml@master
tag:
name: Bump version, push tag and make a release
needs: call-test-workflow
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.70.0
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
id: tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
DEFAULT_BUMP: patch
- name: Get and store tag from 'Bump version and push tag' step
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "TAG_NAME=${{ steps.tag.outputs.new_tag }}" >> $GITHUB_ENV
- name: Get and store tag from triggered tag push
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo "TAG_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG_NAME }}
name: ${{ env.TAG_NAME }}
generate_release_notes: true
wheels:
needs: [call-test-workflow, tag]
uses: ./.github/workflows/build-wheels.yml
tarball:
name: Build tarball
runs-on: ubuntu-22.04
needs: [call-test-workflow, tag]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build a source tarball
run:
python setup.py sdist
- uses: actions/upload-artifact@v4
with:
name: tarball
path: dist
publish:
name: Release and Publish on PyPI
runs-on: ubuntu-22.04
needs: [call-test-workflow, tag, wheels, tarball]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Put artifacts into dist directory
run: |
mkdir -p dist
find artifacts -type f \( -iname \*.whl -o -iname \*.tar.gz \) -exec mv {} dist \;
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}