-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (55 loc) · 2.06 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
name: Fully complete build and upload to Test PyPI workflow
# "on" specifies the workflow trigger.
# Automatic trigger which will be activated on a pushed commit which has a tag
# attached to it with a name starting with "v".
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Initial echo
run: echo "Initialize"
# NOTE: We are using particular commits of all actions to achieve
# reproducibility.
- name: Checkout
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
# NOTE: Use the same python version here as the one you have chosen locally
# in your virtual environment. This is important for reproducibility.
- name: Set up Python
uses: actions/setup-python@c4e89fac7e8767b327bbad6cb4d859eda999cf08
with:
python-version: '3.9'
- name: Install build dependency
run: python3 -m pip install -r requirements-build.txt
- name: Build
run: python3 -m build
- name: Verify release signature
run: |
version=${GITHUB_REF#refs/tags/v}
./release verify $version mvrachev@vmware.com
# Takes the "dist" directory and stores it as "build-artifacts", so that
# in the next job we can access those files. Pass data between 2 steps.
- name: Store build artifacts
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8
with:
name: build-artifacts
path: dist
upload:
runs-on: ubuntu-latest
needs: build
environment: release
steps:
- name: Download artifacts from "build-artifacts"
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
with:
name: build-artifacts
path: dist
- name: Publish binary wheel and source tarball on PyPI
uses: pypa/gh-action-pypi-publish@717ba43cfbb0387f6ce311b169a825772f54d295
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/