Skip to content

add: github action

add: github action #24

Workflow file for this run

name: Release Go Binary for Linux (Multi-arch)
on:
push:
tags:
- "v*"
env:
TZ: Asia/Shanghai
permissions:
contents: write
discussions: write
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
# 定义要构建的 CPU 架构
goarch:
[
386,
amd64,
arm,
arm64,
loong64,
mips,
mipsle,
mips64,
mips64le,
ppc64,
ppc64le,
riscv64,
s390x,
]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Build
# refs/heads/main or refs/tags/v1.0.0
# main or v1.0.0
env:
GOOS: linux
GOARCH: ${{ matrix.goarch }}
VERSION: ${{ github.ref_name }}
run: |
make build
tar -czvf uaProxy-linux-${{ matrix.goarch }}.tar.gz uaProxy config.yaml
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
# tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body_path: Release.md
files: |
uaProxy-linux-${{ matrix.goarch }}.tar.gz