mirror of
https://github.com/samuelncui/yatm.git
synced 2026-02-13 07:11:34 +00:00
94 lines
2.2 KiB
YAML
94 lines
2.2 KiB
YAML
# This workflow will build this project
|
|
|
|
name: Build
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- goos: darwin
|
|
goarch: amd64
|
|
- goos: darwin
|
|
goarch: arm64
|
|
|
|
- goos: freebsd
|
|
goarch: amd64
|
|
|
|
- goos: linux
|
|
goarch: amd64
|
|
tested: '1'
|
|
- goos: linux
|
|
goarch: 386
|
|
- goos: linux
|
|
goarch: arm64
|
|
- goos: linux
|
|
goarch: arm
|
|
goarm: 5
|
|
- goos: linux
|
|
goarch: arm
|
|
goarm: 6
|
|
- goos: linux
|
|
goarch: arm
|
|
goarm: 7
|
|
- goos: linux
|
|
goarch: s390x
|
|
|
|
# remove windows for mount mechanism
|
|
# - goos: windows
|
|
# goarch: amd64
|
|
fail-fast: false
|
|
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RELEASE_VERSION: ${{ github.event.release.tag_name }}
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
GOARM: ${{ matrix.goarm }}
|
|
OSARCH_TESTED: ${{ matrix.tested }}
|
|
CGO_ENABLED: 0
|
|
|
|
steps:
|
|
- name: Set env
|
|
run: |
|
|
if [[ $OSARCH_TESTED == '1' ]]; then
|
|
echo "TARGET_NAME=${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOARM }}" >> $GITHUB_ENV
|
|
else
|
|
echo "TARGET_NAME=${{ env.GOOS }}-${{ env.GOARCH }}${{ env.GOARM }}-experimental" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: "${{ env.RELEASE_VERSION }}"
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.21'
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v3.8.1
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Build
|
|
run: ./build.sh
|
|
|
|
- name: Upload Release Asset
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ./yatm-${{ env.TARGET_NAME }}-${{ env.RELEASE_VERSION }}.tar.gz
|
|
asset_name: yatm-${{ env.TARGET_NAME }}-${{ env.RELEASE_VERSION }}.tar.gz
|
|
asset_content_type: application/x-tgz
|