release: 1.13 #7
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
name: Publish Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.6' | |
- name: Build with Go | |
run: | | |
platforms=( | |
"linux amd64 tunmanager_linux_amd64" | |
"linux arm64 tunmanager_linux_arm64" | |
) | |
for platform in "${platforms[@]}"; do | |
set -- $platform | |
GOOS=$1 GOARCH=$2 go build -o $3 -ldflags="-w -s" -trimpath -v . | |
done | |
- name: Extract changelog | |
env: | |
REF: ${{ github.ref }} | |
run: | | |
sed -n "/^## ${REF:10}/,/^## /{/^## /b;p}" CHANGELOG.md > RELEASE_CHANGELOG | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} | |
body_path: RELEASE_CHANGELOG | |
files: tunmanager_* |