fix: don't work with relative target path #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/[email protected] | |
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 |