-
Notifications
You must be signed in to change notification settings - Fork 9
78 lines (73 loc) · 2.08 KB
/
deployment.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
name: Continuous Delivery
env:
# NOTE: This version must match between all .yml files in the
# .github/workflows directory
TOX_VERSION: 4.0.9
on:
release:
types: [released]
jobs:
homebrew:
runs-on: ubuntu-latest
steps:
- name: Bump Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.JOHAN_GITHUB_API_TOKEN}}
formula: px
pypi:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pxpx
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
#
# First, we need to create a wheel. We do this by running tox, just like
# in linux-ci.yml.
#
- name: Check out repository code
uses: actions/checkout@v4
with:
# For getting tags from the repo
fetch-depth: 0
fetch-tags: true
- name: Force git describe to show the right tag
# Workaround for: https://github.com/actions/checkout/issues/882
run: |
git describe --dirty
git fetch --tags --force
git describe --dirty
- name: Cache .tox directory
uses: actions/cache@v3
with:
path: .tox
key: ${{ runner.os }}-${{ hashFiles('tox.ini') }}
- name: Create a virtualenv
run: |
python3 -m venv env
- name: Install tox in our virtualenv
run: |
. ./env/bin/activate
pip install tox==${{ env.TOX_VERSION }}
- name: Prevent 0.0.0 releases I
run: |
. ./env/bin/activate
tox -e version.py
cat px/version.py
! grep '0.0.0' px/version.py
- name: Run tox to create the dist wheel
run: |
. ./env/bin/activate
tox
- name: Prevent 0.0.0 releases II
run: |
ls dist/
! ls dist/ | grep '0.0.0'
#
# Wheel created, publish it!
#
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1