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.
synctv/.github/workflows/release.yml

65 lines
1.7 KiB
YAML

name: release
on:
push:
tags:
- "v*"
jobs:
get-targets:
name: Get all targets
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.get-targets.outputs.targets }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get targets
id: get-targets
uses: zijiren233/go-build-action@v1
with:
show-all-targets: true
release:
name: Release
needs: get-targets
runs-on: ubuntu-latest
strategy:
matrix:
target: ${{ fromJson(needs.get-targets.outputs.targets) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_OUTPUT
- name: Build targets
uses: zijiren233/go-build-action@v1
with:
targets: ${{ matrix.target }}
enable-micro: ${{ !endsWith(matrix.target, '-arm64') }}
config-args: --version="v${{ steps.get_version.outputs.VERSION }}"
- 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/*