Skip to content

Upload build asset

Upload build asset #7

Workflow file for this run

name: Upload build asset
on:
release:
types: [ published ]
jobs:
build:
name: Upload build asset for ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: linux 386
os: ubuntu-latest
buildCmd: make buildLinux386
file: zparser-linux-i386
compress: true
strip: true
runLint: true
runTests: true
- name: linux amd64
os: ubuntu-latest
buildCmd: make buildLinuxAmd64
file: zparser-linux-amd64
compress: true
strip: true
runLint: true
runTests: true
- name: darwin amd64
os: macos-latest
buildCmd: make buildMacAmd64
file: zparser-darwin-amd64
compress: false
strip: false
runLint: true
runTests: true
- name: darwin arm64
os: macos-latest
buildCmd: make buildMacArm64
file: zparser-darwin-arm64
compress: false
strip: false
runLint: false
runTests: false
- name: windows amd64
os: ubuntu-latest
buildCmd: make buildWindows
file: zparser-win-x64.exe
compress: false
strip: false
runLint: false
runTests: false
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ~1.19
id: go
- name: Checkout code
uses: actions/checkout@v4
- name: Get dependencies
run: |
export GOPATH=$HOME/go
- name: Build
run: ${{ matrix.buildCmd }}
- name: Compress binary
if: ${{ matrix.compress }}
uses: svenstaro/upx-action@cf8fc6f17554e2c3ac67a479a60cf71b48babc4f
with:
file: ./bin/${{ matrix.file }}
strip: ${{ matrix.strip }}
- name: Upload to Release Action
uses: Shopify/upload-to-release@c77c9b3e5d288adaef98a7007bf92340ec6ce03b
with:
name: ${{ matrix.file }}
path: ./bin/${{ matrix.file }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
content-type: application/octet-stream