-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (77 loc) · 2.89 KB
/
package.yml
File metadata and controls
85 lines (77 loc) · 2.89 KB
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
79
80
81
82
83
84
85
name: package
on:
release:
types: [published]
jobs:
# Use an older Linux: https://pyinstaller.org/en/stable/usage.html#making-gnu-linux-apps-forward-compatible
# Ubuntu 20.04 isn't supported by GitHub Actions.
package-linux:
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
steps:
# include binutils, pyinstaller needs objdump
- name: Install dependencies
run: |
apt-get update
apt-get install -y git zip curl binutils
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
# the checkout action has to be after a newer version of git is installed
# see https://github.com/actions/checkout/issues/335. we need the git directory
# for setuptools-scm to work.
- uses: actions/checkout@v3
# the setup-python action doesn't work due to the older version of glibc
# see https://github.com/actions/setup-python/issues/1053
- name: Set up Python
run: |
uv python install 3.10
ln -s $(uv python find 3.10) /usr/bin/python
ln -s $(dirname $(uv python find 3.10))/pip /usr/bin/pip
- name: Run packaging step
run: |
uvx tox -e package
- name: Install GitHub CLI
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt-get update
apt-get install -y gh
# this is needed when building in docker since the repo is cloned as root.
# see https://stackoverflow.com/questions/73408170/git-fatal-detected-dubious-ownership
- name: Allow git to run against root owned files
run: |
git config --global --add safe.directory $(pwd)
- name: Zip and upload binary
run: |
.github/zip_and_upload_package.sh Linux ${{ github.event.release.tag_name }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package-macos-windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install tox
run: |
pip install --upgrade pip
pip install tox
- name: Run packaging step
run: |
tox -e package
- name: Zip and upload binary
run: |
.github/zip_and_upload_package.sh ${{ runner.os }} ${{ github.event.release.tag_name }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}