-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (52 loc) · 1.76 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: release
# Automate deployment to PyPI when creating a release tag vX.Y.Z
# will only be published to PyPI if the git tag matches the release version
# and the pre-commit and tests pass
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
check-release-tag:
if: github.repository == 'aiidateam/disk-objectstore'
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Validate the tag version against the package version
run: python .github/workflows/check_release_tag.py $GITHUB_REF disk_objectstore/__init__.py
pre-commit:
needs: [check-release-tag]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
cache-dependency-path: pyproject.toml
- uses: pre-commit/[email protected]
publish:
name: Publish to PyPI
needs: [check-release-tag, pre-commit]
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Install Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install flit
run: pip install flit~=3.4
- name: Build and publish
run: flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_KEY }}