Files
mhr-cfw-go/.github/workflows/build.yml
T
2026-05-04 08:02:22 +03:30

47 lines
1.0 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release:
description: 'Create release'
required: false
default: 'true'
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
- name: Download for release
uses: actions/download-artifact@v4
with:
name: mhr-cfw-go
path: .
- name: Release
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: mhr-cfw-go.exe
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}