Skip to content

Migrate build from gitea to Github #6

Migrate build from gitea to Github

Migrate build from gitea to Github #6

Workflow file for this run

name: Run all tests
on:
push:
branches:
- 'master'
tags:
- '**'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
schedule:
- cron: '30 4 * * SAT'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-24.05
- uses: workflow/nix-shell-action@v3
with:
packages: zig
script: |
zig build test
- uses: workflow/nix-shell-action@v3
with:
packages: zig
script: |
zig build test
if [ "${GITHUB_REF}" == "refs/tags/*" ]; then
zig build -Doptimize=ReleaseSafe -Dtarget=aarch64-macos-none --summary all
fi
- uses: workflow/nix-shell-action@v3
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
packages: zig
script: |
zig build -Doptimize=ReleaseSafe -Dtarget=aarch64-macos-none --summary all
- uses: actions/upload-artifact@v4
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: my-artifact
path: ghh
release:
runs-on: ubuntu-latest
# if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
needs: [ test ]
strategy:
matrix:
include:
- target: aarch64-macos-none
name: ghh_darwin_aarch64.zip
- target: x86_64-macos-none
name: ghh_darwin_x86_64.zip
- target: x86_64-linux-musl
name: ghh_linux_x86_64.zip
- target: aarch64_be-linux-musl
name: ghh_linux_aarch64.zip
target:
- aarch64-macos-none
- x86_64-macos-none
- x86_64-linux-musl
- aarch64_be-linux-musl
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-24.05
- uses: workflow/nix-shell-action@v3
env:
target: ${{ matrix.target }}
with:
packages: zig
script: |
zig build -Doptimize=ReleaseSafe -Dtarget=${{matrix.target}} --summary all && (cd zig-out/bin && zip ghh.zip ghh)
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.name}}.zip
path: zig-out/bin/ghh.zip