Skip to content

Commit

Permalink
cd: Test on push
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Sep 17, 2024
1 parent 7cf7933 commit 0d31080
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 128 deletions.
50 changes: 1 addition & 49 deletions .github/workflows/cd-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
name: Continuous delivery - Linux

on:
release:
types: [prereleased, released]
push:

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]+(-rc\.[1-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
Expand All @@ -45,35 +29,3 @@ jobs:
. 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
80 changes: 1 addition & 79 deletions .github/workflows/cd-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
name: Continuous delivery - Windows

on:
release:
types: [prereleased, released]
push:

env:
FLIT_ROOT_INSTALL: 1

jobs:
version-check:
name: Check versioning
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check version tag format
run: |
$VERSION_TAG="${{ github.event.release.tag_name }}"
if ($VERSION_TAG -match "^v[0-9]+.[0-9]+.[0-9]+(-rc\.[1-9])?$") {exit 0} else {exit 1}
- name: Check if version tag and package version are equal
run: |
$VERSION_TAG="${{ github.event.release.tag_name }}"
$VERSION_FILE=Get-Content .\pynitrokey\VERSION
if ($VERSION_TAG.Substring(1) -eq $VERSION_FILE) {exit 0} else {exit 1}
build-onedir:
name: Build onedir
runs-on: windows-latest
needs: version-check
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -48,15 +31,9 @@ jobs:
run: |
.\venv\Scripts\Activate.ps1
pyinstaller ci-scripts/windows/pyinstaller/pynitrokey-onedir.spec
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pynitrokey-onedir
path: dist/nitropy
build-onefile:
name: Build onefile
runs-on: windows-latest
needs: version-check
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -78,11 +55,6 @@ jobs:
run: |
.\venv\Scripts\Activate.ps1
pyinstaller ci-scripts/windows/pyinstaller/pynitrokey-onefile.spec
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pynitrokey-onefile
path: dist/nitropy.exe
build-msi-installer:
name: Build MSI installer
runs-on: windows-latest
Expand Down Expand Up @@ -126,53 +98,3 @@ jobs:
.\Product.wixobj `
.\Sources.wixobj `
-o nitropy.msi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nitropy-installer
path: nitropy.msi
publish-binary:
name: Publish binary
runs-on: windows-latest
needs: build-onefile
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: pynitrokey-onefile
- name: Rename binary
run: |
mv `
nitropy.exe `
nitropy-${{ github.event.release.tag_name }}-x64-windows-binary.exe
- name: Create archive
run: |
7z a -tzip -mx9 `
nitropy-${{ github.event.release.tag_name }}-x64-windows-binary.zip `
nitropy-${{ github.event.release.tag_name }}-x64-windows-binary.exe
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: nitropy-${{ github.event.release.tag_name }}-x64-windows-binary.zip
publish-msi-installer:
name: Publish MSI installer
runs-on: windows-latest
needs: build-msi-installer
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: nitropy-installer
- name: Rename installer
run: |
mv `
nitropy.msi `
nitropy-${{ github.event.release.tag_name }}-x64-windows-installer.msi
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: nitropy-${{ github.event.release.tag_name }}-x64-windows-installer.msi

0 comments on commit 0d31080

Please sign in to comment.