Skip to content

chore: Better body + tag name from branch name #11

chore: Better body + tag name from branch name

chore: Better body + tag name from branch name #11

name: Rolling Release Binaries
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
- aarch64-apple-darwin
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
steps:
- name: Setup repo
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Deno
uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- name: Set binary name
id: binary-name
run: |
case "${{ matrix.target }}" in
*-windows-*)
echo "name=invidious_companion.exe" >> $GITHUB_OUTPUT
echo "archive_name=invidious_companion-${{ matrix.target }}.zip" >> $GITHUB_OUTPUT
;;
*)
echo "name=invidious_companion" >> $GITHUB_OUTPUT
echo "archive_name=invidious_companion-${{ matrix.target }}.tar.gz" >> $GITHUB_OUTPUT
;;
esac
- name: Build binary
run: |
deno compile \
--target="${{ matrix.target }}" \
--output "${{ steps.binary-name.outputs.name }}" \
src/main.ts
- name: Create archive
run: |
case "${{ matrix.target }}" in
*-windows-*)
zip "${{ steps.binary-name.outputs.archive_name }}" "${{ steps.binary-name.outputs.name }}"
;;
*)
tar -czf "${{ steps.binary-name.outputs.archive_name }}" "${{ steps.binary-name.outputs.name }}"
;;
esac
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.target }}
path: ${{ steps.binary-name.outputs.archive_name }}
retention-days: 90
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- uses: ncipollo/release-action@v1
with:
tag: ${{ github.ref_name }}
removeArtifacts: true
allowUpdates: true
artifacts: artifacts/**
body: |
Binaries from ${{ github.ref_name }} branch.