forked from Gibies/CSET
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (59 loc) · 1.95 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
72
name: Publish packages
on:
release:
types: [released]
# Allow only one concurrent deployment
concurrency:
group: "release"
cancel-in-progress: false
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.x"
- name: Install dependencies
run: python3 -m pip install build
- name: Build package
run: python3 -m build
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: packages
path: dist/
retention-days: 10
if-no-files-found: error
pypi-publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: build-package
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: packages
path: dist/
# External actions are disabled via organization policies therefore we
# must instead manually implement it.
# https://docs.pypi.org/trusted-publishers/using-a-publisher/#the-manual-way
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
- name: Setup python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install twine
- name: Check package metadata
run: python -m twine check --strict dist/*
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: python3 -m twine upload --disable-progress-bar --verbose --non-interactive dist/*