Skip to content

Update go.yml

Update go.yml #4

Workflow file for this run

name: Release Build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30 # 设置超时时间为 30 分钟
strategy:
matrix:
os: [windows, darwin, linux]
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: |
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o myapp-${{ matrix.os }}-${{ matrix.arch }}
tar -czvf myapp-${{ matrix.os }}-${{ matrix.arch }}.tar.gz myapp-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./myapp-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_name: myapp-${{ matrix.os }}-${{ matrix.arch }}.tar.gz
asset_content_type: application/gzip