-
Notifications
You must be signed in to change notification settings - Fork 28
85 lines (82 loc) · 2.63 KB
/
cd-linux.yaml
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: Continuous delivery - Linux
on:
release:
types: [prereleased, released]
env:
FLIT_ROOT_INSTALL: 1
jobs:
version-check:
name: Check versioning
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check version tag format
run: |
TAG_VERSION="${{ github.event.release.tag_name }}"
if [[ $TAG_VERSION =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then exit 0; else exit 1; fi
- name: Check if version tag and package version are equal
run: |
TAG_VERSION="${{ github.event.release.tag_name }}"
if [ ${TAG_VERSION:1} == $(cat pynitrokey/VERSION) ]; then exit 0; else exit 1; fi
build-onefile:
name: Build onefile
runs-on: ubuntu-latest
container: python:3.9-slim
needs: version-check
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install required packages
run: |
apt update
apt install -y binutils gcc git libpcsclite-dev libusb-1.0-0 make swig
- name: Create virtual environment
run: |
python -m venv venv
. venv/bin/activate
pip install flit
flit install --symlink
- name: Patch oscrypto
run: |
. venv/bin/activate
pip uninstall -y oscrypto
: # This uses an oscrypto version to avoid issue #431
pip install "oscrypto @ git+https://github.com/wbond/oscrypto.git@1547f535001ba568b239b8797465536759c742a3"
- name: Build
run: |
. venv/bin/activate
pyinstaller \
ci-scripts/linux/pyinstaller/pynitrokey-onefile.spec
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nitropy-onefile
path: dist/nitropy
publish-binary:
name: Publish binary
runs-on: ubuntu-latest
container: python:3.9-slim
needs: build-onefile
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: nitropy-onefile
- name: Rename binary
run: |
mv \
nitropy \
nitropy-${{ github.event.release.tag_name }}-x64-linux-binary
- name: Create archive
run: |
tar \
-czvf \
nitropy-${{ github.event.release.tag_name }}-x64-linux-binary.tar.gz \
nitropy-${{ github.event.release.tag_name }}-x64-linux-binary
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: nitropy-${{ github.event.release.tag_name }}-x64-linux-binary.tar.gz