Skip to content

Add GitHub Actions release workflow and AUR package files #2

Add GitHub Actions release workflow and AUR package files

Add GitHub Actions release workflow and AUR package files #2

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yml

Invalid workflow file

(Line: 30, Col: 12): Unexpected symbol: '+'. Located at position 19 within expression: matrix.abi && '-' + matrix.abi || '', (Line: 37, Col: 15): Unexpected symbol: '+'. Located at position 19 within expression: matrix.abi && '-' + matrix.abi || '', (Line: 38, Col: 15): Unexpected symbol: '+'. Located at position 19 within expression: matrix.abi && '-' + matrix.abi || ''
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
matrix:
include:
- { arch: aarch64, os: macos }
- { arch: x86_64, os: macos }
- { arch: aarch64, os: linux }
- { arch: x86_64, os: linux, abi: gnu }
- { arch: x86_64, os: linux, abi: musl }
- { arch: x86_64, os: windows }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: latest
- name: Build
run: |
TARGET="${{ matrix.arch }}-${{ matrix.os }}${{ matrix.abi && '-' + matrix.abi || '' }}"
zig build -Dcross=true -Doptimize=ReleaseFast
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: shgit-${{ matrix.arch }}-${{ matrix.os }}${{ matrix.abi && '-' + matrix.abi || '' }}
path: zig-out/bin/${{ matrix.arch }}-${{ matrix.os }}${{ matrix.abi && '-' + matrix.abi || '' }}/shgit${{ matrix.os == 'windows' && '.exe' || '' }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/**/*.tar.gz
generate_release_notes: true