Smail/plugins/pmail_telegram_push/.github/workflows/release.yaml

58 lines
1.5 KiB
YAML

name: Release Binary
on:
push:
tags:
- 'v*'
jobs:
build:
strategy:
matrix:
goos: ['linux', 'darwin', 'windows']
goarch: ['amd64', 'arm64']
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10'
run_install: true
standalone: true
- name: Download dependencies
run: |
go mod tidy
go mod download
- name: Build binary
run: |
pnpm build
if [[ "${{ matrix.goos }}" = "windows" ]]; then
go build -o pmail_telegram_push_${{ matrix.goos }}_${{ matrix.goarch }}.exe -ldflags="-s -w"
else
go build -o pmail_telegram_push_${{ matrix.goos }}_${{ matrix.goarch }} -ldflags="-s -w"
fi
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
- name: Publish Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: 'pmail_telegram_push_${{ matrix.goos }}_${{ matrix.goarch }}*'
commit: ${{ github.sha }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}