71 lines
1.6 KiB
Go
71 lines
1.6 KiB
Go
# This workflow will build a golang project
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
|
|
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24.x'
|
|
|
|
- name: Install gf CLI
|
|
run: |
|
|
curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64
|
|
chmod +x gf
|
|
mkdir -p "$HOME/bin"
|
|
mv gf "$HOME/bin/gf"
|
|
echo "$HOME/bin" >> $GITHUB_PATH
|
|
|
|
- name: Verify gf
|
|
run: gf -v
|
|
|
|
- name: Build with gf
|
|
run: gf build -ew -v "${{ github.ref_name }}"
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: uploads3-${{ github.ref_name }}
|
|
path: |
|
|
bin/**
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: uploads3-${{ github.ref_name }}
|
|
path: bin
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag_name: ${{ github.ref_name }}
|
|
name: ${{ github.ref_name }}
|
|
draft: false
|
|
prerelease: false
|
|
files: |
|
|
bin/**
|