Files
mhr-cfw-go/.github/workflows/build.yml
T
2026-05-04 07:52:54 +03:30

54 lines
1.1 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build
run: go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mhr-cfw-go
path: mhr-cfw-go.exe
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: mhr-cfw-go
path: .
- name: Extract version
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
files: mhr-cfw-go.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}