ci(nix): add archive packages and overhaul CI workflows
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: Publish Docker Images
|
||||
name: Run checks and build archives
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -6,7 +6,7 @@ on:
|
||||
- main
|
||||
- develop
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
- "v*.*.*"
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
@@ -56,32 +56,36 @@ jobs:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
|
||||
- name: Build Linux release binary
|
||||
run: nix build --no-pure-eval --accept-flake-config
|
||||
build:
|
||||
needs: coverage-and-sonar
|
||||
strategy:
|
||||
matrix:
|
||||
target: ["linux-x86_64", "linux-aarch64", "windows-x86_64"]
|
||||
|
||||
- name: Prepare Linux binary
|
||||
run: |
|
||||
mkdir dist-linux
|
||||
cp result/bin/jj-cz dist-linux/
|
||||
cp LICENSE.*.md dist-linux/
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Upload Linux artifact
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
- name: Set up cachix
|
||||
uses: cachix/cachix-action@v17
|
||||
with:
|
||||
name: phundrak
|
||||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
|
||||
|
||||
- name: Build jj-cz archive
|
||||
run: nix build .#${{matrix.target}}-archive
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jj-cz-x86_64-unknown-linux-gnu
|
||||
path: dist-linux/*
|
||||
|
||||
- name: Build Windows release binary
|
||||
run: nix build .#windows --no-pure-eval --accept-flake-config
|
||||
|
||||
- name: Prepare Windows binary
|
||||
run: |
|
||||
mkdir -p dist-windows
|
||||
cp result/bin/jj-cz.exe dist-windows/
|
||||
cp LICENSE.*.md dist-windows/
|
||||
|
||||
- name: Upload Windows artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: jj-cz-x86_64-pc-windows-gnu
|
||||
path: dist-windows/*
|
||||
name: jj-cz-${{matrix.target}}
|
||||
path: result/dist/*
|
||||
|
||||
Reference in New Issue
Block a user