Skip to content

Commit

Permalink
Release binaries, because why not?
Browse files Browse the repository at this point in the history
  • Loading branch information
ukautz committed Apr 22, 2023
1 parent 5111fc0 commit 6e2d87a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Upload Release Asset

on:
push:
tags:
- "v*"

jobs:
release:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "^1.17"
- run: go version
- name: Build binaries
run: |
GOOS=linux GOARCH=amd64 go build -o dist/omh.linux-amd64 cmds/omh/main.go
GOOS=linux GOARCH=arm64 go build -o dist/omh.linux-arm64 cmds/omh/main.go
GOOS=darwin GOARCH=amd64 go build -o dist/omh.darwin-amd64 cmds/omh/main.go
GOOS=darwin GOARCH=arm64 go build -o dist/omh.darwin-arm64 cmds/omh/main.go
GOOS=windows GOARCH=amd64 go build -o dist/omh.windows-amd64.exe cmds/omh/main.go
- name: Create archives
run: |
set -x
cd dist
for asset in ./omh.*; do
gzip --keep $asset
done
- name: Create release
run: |
set -x
assets=()
for asset in ./dist/omh.*; do
assets+=("-a" "$asset")
done
tag_name="${GITHUB_REF##*/}"
hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 6e2d87a

Please sign in to comment.