Some checks failed
CI / Test (push) Successful in 2s
CI / Build aarch64-unknown-linux-gnu (push) Successful in 3s
CI / Build x86_64-unknown-linux-gnu (push) Successful in 3s
CI / Build x86_64-unknown-linux-musl (push) Successful in 3s
CI / Create release (push) Failing after 11s
77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: "CI"
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: native
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Run unit tests
|
|
run: nix build --print-build-logs .#checks.x86_64-linux.default
|
|
|
|
build:
|
|
name: Build ${{ matrix.target }}
|
|
runs-on: native
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- package: x86_64-linux
|
|
target: x86_64-unknown-linux-gnu
|
|
- package: x86_64-linux-musl
|
|
target: x86_64-unknown-linux-musl
|
|
- package: aarch64-linux
|
|
target: aarch64-unknown-linux-gnu
|
|
# TODO: need macOS runners for these
|
|
# - package: default
|
|
# target: x86_64-apple-darwin
|
|
# system: x86_64-darwin
|
|
# - package: default
|
|
# target: aarch64-apple-darwin
|
|
# system: aarch64-darwin
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build
|
|
run: nix build --print-build-logs .#packages.x86_64-linux.${{ matrix.package }}
|
|
|
|
- name: Prepare release artifact
|
|
if: startsWith(forgejo.ref, 'refs/tags/')
|
|
run: cp result/bin/mkv mkv-${{ matrix.target }}
|
|
|
|
- name: Upload artifact
|
|
if: startsWith(forgejo.ref, 'refs/tags/')
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: mkv-${{ matrix.target }}
|
|
path: mkv-${{ matrix.target }}
|
|
|
|
release:
|
|
name: Create release
|
|
needs: [test, build]
|
|
runs-on: native
|
|
if: startsWith(forgejo.ref, 'refs/tags/')
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
- name: Collect artifacts
|
|
run: |
|
|
mkdir -p release
|
|
find artifacts -type f -name 'mkv-*' -exec mv {} release/ \;
|
|
ls -la release/
|
|
|
|
- name: Create release
|
|
uses: actions/forgejo-release@v2
|
|
with:
|
|
direction: upload
|
|
release-dir: release
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|