modify error output #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
push: | |
branches: | |
- master | |
paths: | |
- "**/*.go" | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths: | |
- "**/*.go" | |
jobs: | |
build: | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
goos: [windows, linux, darwin] | |
goarch: [amd64, arm64] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
CGO_ENABLED: 0 | |
steps: | |
- name: Checkout codebase | |
uses: actions/checkout@v3 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '>=1.20.0' | |
check-latest: true | |
- run: go mod download | |
- name: Build iwaradl | |
run: | | |
go build -trimpath -ldflags "-s -w -buildid=" . | |
- name: Upload files to Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: iwaradl-${{ env.GOOS }}-${{ env.GOARCH }} | |
path: | | |
./iwaradl* | |
./config.yaml | |
- name: Make release folder | |
if: github.event_name == 'release' | |
run: | | |
mkdir release && mv ./iwaradl* ./release/ && mv ./config.yaml ./release/ | |
- name: Archive Release | |
uses: thedoctor0/zip-release@0.7.1 | |
if: github.event_name == 'release' | |
with: | |
type: 'zip' | |
filename: "iwaradl-${{ env.GOOS }}-${{ env.GOARCH }}.zip" | |
directory: ./release | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
if: github.event_name == 'release' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: "./release/iwaradl-${{ env.GOOS }}-${{ env.GOARCH }}.zip" | |
asset_name: iwaradl-${{ env.GOOS }}-${{ env.GOARCH }}.zip | |
tag: ${{ github.ref }} |