Skip to content

Build

Build #39

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build
on:
push:
paths:
- "**.go"
- go.mod
- go.sum
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform: [windows, darwin, linux]
arch: [amd64, 386]
exclude:
- platform: darwin
arch: 386
steps:
- name: Set up repo
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod
- name: Build
run: go build -o release/
env:
GOOS: ${{ matrix.platform }}
GOARCH: ${{ matrix.arch }}
- name: Upload binaries to release
run: |
binary=(release/*)
archive=ao3fetch-${{ github.ref_name }}-${{ matrix.platform }}-${{ matrix.arch }}.zip
zip $archive ${binary[0]}
gh release upload ${{ github.ref_name }} $archive#${{ matrix.platform }}-${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ github.token }}
if: github.event_name == 'release'