Add permission #35
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 Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
name: Build ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
target: aarch64-macos | |
- os: macos-13 | |
target: x86_64-macos | |
- os: ubuntu-latest | |
target: x86_64-linux | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Zig | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: 0.13.0 | |
- name: Setup FFmpeg (macOS) | |
if: runner.os == 'macOS' | |
run: brew install ffmpeg pkg-config coreutils | |
- name: Setup FFmpeg (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y ffmpeg libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev pkg-config | |
- name: Build | |
run: | | |
mkdir -p artifacts | |
zig build -Doptimize=ReleaseFast -Dstrip=true | |
tar czf artifacts/asciigen-${{ matrix.target }}.tar.gz -C zig-out/bin . | |
cd artifacts && sha256sum asciigen-${{ matrix.target }}.tar.gz > asciigen-${{ matrix.target }}.tar.gz.sha256 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifacts | |
path: artifacts/ | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: "write-all" | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-artifacts | |
path: artifacts | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: artifacts/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |