Continuous delivery - Linux #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |