mirror of https://github.com/synctv-org/synctv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
get_all_targets:
|
|
name: Get all targets
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
TARGETS: ${{ steps.get_all_targets.outputs.TARGETS }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get all targets
|
|
id: get_all_targets
|
|
run: |
|
|
declare -a arr=()
|
|
OIFS="$IFS"
|
|
IFS=$'\n,'
|
|
for line in $(script/build.sh -t); do
|
|
arr+=("$line")
|
|
done
|
|
IFS="$OIFS"
|
|
printf -v json '"%s",' "${arr[@]}"
|
|
json="[${json%,}]"
|
|
echo "TARGETS=$json" >> $GITHUB_OUTPUT
|
|
|
|
release:
|
|
name: Release
|
|
needs: get_all_targets
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
target: ${{ fromJson(needs.get_all_targets.outputs.TARGETS) }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.22"
|
|
|
|
- name: Get version
|
|
id: get_version
|
|
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build
|
|
run: |
|
|
bash script/build.sh -v "v${{ steps.get_version.outputs.VERSION }}" -p "${{ matrix.target }}" -m '-a -v'
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
draft: false
|
|
prerelease: ${{ contains(steps.get_version.outputs.VERSION, 'rc') || contains(steps.get_version.outputs.VERSION, 'beta') || contains(steps.get_version.outputs.VERSION, 'alpha') }}
|
|
append_body: false
|
|
fail_on_unmatched_files: true
|
|
name: "Version ${{ steps.get_version.outputs.VERSION }}"
|
|
tag_name: "v${{ steps.get_version.outputs.VERSION }}"
|
|
files: |
|
|
build/* |