Build and Test #18
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: Build and Test | |
on: | |
release: | |
types: [ published ] | |
push: | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: [ "age-plugin-op-linux-arm64", "age-plugin-op-linux-arm32", "age-plugin-op-linux-amd64", | |
"age-plugin-op-darwin-amd64", "age-plugin-op-darwin-arm64" ] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v24 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
with: | |
# Disable diagnostics | |
diagnostic-endpoint: "" | |
- name: Build | |
run: nix build .#${{ matrix.package }} -L | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.package }} | |
path: result/**/age-plugin-op* | |
if-no-files-found: error | |
upload: | |
name: Upload Release Binaries | |
if: github.event_name == 'release' | |
needs: build | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Build Artifacts | |
uses: actions/download-artifact@v4 | |
- name: Upload Release Artifacts | |
run: gh release upload "$GITHUB_REF_NAME" age-plugin-op-* | |
env: | |
GH_REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ github.token }} |