-
Notifications
You must be signed in to change notification settings - Fork 37
71 lines (58 loc) · 1.68 KB
/
publish-main.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: Upload to Test PyPI
# On every push to main, push to Test PyPI
on:
push:
#branches:
# - main
# TODO: De-duplicate with build-test.yml
# TODO: De-duplicate with python-publish-release.yml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
- name: Unshallow checkout
run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
sudo apt-get update
sudo apt-get install -y musl-tools scons
- name: Build
env:
BOOTLOADER_CC: /usr/bin/musl-gcc
CI_VERSION_BUILD_NUMBER: ${{ github.run_id }}
run: python setup.py sdist bdist_wheel
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: python-dist
path: dist/
pypi-publish:
name: Upload release to Test PyPI
runs-on: ubuntu-latest
environment:
name: TestPyPI
url: https://test.pypi.org/project/staticx/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: python-dist
path: dist/
- name: Display downloaded files
run: ls -R
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
print-hash: true
repository-url: https://test.pypi.org/legacy/