Skip to content

Release

Release #13

Workflow file for this run

name: Release
on:
release:
types: [created]
push:
branches: [prod]
jobs:
release:
name: Release ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-musl
goos: linux
goarch: amd64
archive: zip
- target: x86_64-pc-windows-gnu
goos: windows
goarch: amd64
archive: zip
- target: x86_64-apple-darwin
goos: darwin
goarch: amd64
archive: zip
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.22.2
- name: Build
run: |
export GOOS=${{ matrix.goos }}
export GOARCH=${{ matrix.goarch }}
go build
if [ "${{ matrix.archive }}" == "zip" ]; then
zip ypd.${{ matrix.target }}.zip ypd
else
tar -czf ypd.${{ matrix.target }}.${{ matrix.archive }} ypd
fi
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./app.${{ matrix.target }}.${{ matrix.archive }}
asset_name: app-${{ matrix.target }}.${{ matrix.archive }}
asset_content_type: application/octet-stream