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.
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
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 $(BUILD_CONFIG=script/build.config.sh bash script/build.sh --show-all-platforms); do
|
|
arr+=("$line")
|
|
done
|
|
IFS="$OIFS"
|
|
printf -v json '"%s",' "${arr[@]}"
|
|
json="[${json%,}]"
|
|
echo "TARGETS=$json" >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: get_all_targets
|
|
strategy:
|
|
matrix:
|
|
target: ${{ fromJson(needs.get_all_targets.outputs.TARGETS) }}
|
|
steps:
|
|
- name: Free Disk Space (Ubuntu)
|
|
uses: jlumbroso/free-disk-space@main
|
|
with:
|
|
tool-cache: false
|
|
android: true
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: false
|
|
docker-images: true
|
|
swap-storage: true
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23"
|
|
|
|
- name: Build
|
|
run: |
|
|
BUILD_CONFIG=script/build.config.sh bash \
|
|
script/build.sh \
|
|
--enable-micro \
|
|
--skip-init-web \
|
|
--platforms="${{ matrix.target }}" \
|
|
--more-go-cmd-args='-a -v'
|
|
|
|
- name: Get artifact name
|
|
id: get_artifact_name
|
|
run: |
|
|
echo "ARTIFACT_NAME=$(echo ${{ matrix.target }} | tr '/' '-')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ steps.get_artifact_name.outputs.ARTIFACT_NAME }}
|
|
path: build/*
|