|
|
|
@ -13,36 +13,28 @@ concurrency:
|
|
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
get_all_targets:
|
|
|
|
|
get-targets:
|
|
|
|
|
name: Get all targets
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
outputs:
|
|
|
|
|
TARGETS: ${{ steps.get_all_targets.outputs.TARGETS }}
|
|
|
|
|
targets: ${{ steps.get-targets.outputs.targets }}
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
- 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
|
|
|
|
|
- name: Get All Targets
|
|
|
|
|
id: get-targets
|
|
|
|
|
uses: zijiren233/go-build-action@main
|
|
|
|
|
with:
|
|
|
|
|
show-all-targets: true
|
|
|
|
|
build-config: script/build.config.sh
|
|
|
|
|
|
|
|
|
|
build:
|
|
|
|
|
name: Build
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
needs: get_all_targets
|
|
|
|
|
needs: get-targets
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
target: ${{ fromJson(needs.get_all_targets.outputs.TARGETS) }}
|
|
|
|
|
target: ${{ fromJson(needs.get-targets.outputs.targets) }}
|
|
|
|
|
steps:
|
|
|
|
|
- name: Free Disk Space (Ubuntu)
|
|
|
|
|
uses: jlumbroso/free-disk-space@main
|
|
|
|
@ -63,14 +55,14 @@ jobs:
|
|
|
|
|
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: Build targets
|
|
|
|
|
uses: zijiren233/go-build-action@main
|
|
|
|
|
with:
|
|
|
|
|
targets: ${{ matrix.target }}
|
|
|
|
|
build-config: script/build.config.sh
|
|
|
|
|
enable-micro: true
|
|
|
|
|
more-go-cmd-args: "-a -v"
|
|
|
|
|
config-args: "--skip-init-web"
|
|
|
|
|
|
|
|
|
|
- name: Get artifact name
|
|
|
|
|
id: get_artifact_name
|
|
|
|
|