Files
mhr-cfw-go/.github/workflows/build.yml
T
2026-05-08 07:43:24 +03:30

91 lines
2.3 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
- os: windows-latest
goos: windows
goarch: amd64
- os: windows-latest
goos: windows
goarch: arm64
- os: windows-latest
goos: windows
goarch: 386
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Build
shell: bash
run: |
export GOOS=${{ matrix.goos }}
export GOARCH=${{ matrix.goarch }}
go build -ldflags "-s -w" -o mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/mhr-cfw
- name: Rename Windows executable
if: matrix.goos == 'windows'
shell: bash
run: mv mhr-cfw-go-windows-${{ matrix.goarch }} mhr-cfw-go-windows-${{ matrix.goarch }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }}
path: mhr-cfw-go-${{ matrix.goos }}-${{ matrix.goarch }}*
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Release
uses: softprops/action-gh-release@v2
with:
files: mhr-cfw-go-*
body: |
## Bug Fixes
- Fixed Telegram API connectivity issues
- Fixed encoding issues on some websites (brotli/zstd decompression)
## Improvements
- Better compatibility with Google Apps Script relay
🦢
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}