Skip to content

Commit

Permalink
release binary to github (#76)
Browse files Browse the repository at this point in the history
this builds and publishes `allorad` to the assets of a gitHub release.

---------

Signed-off-by: Derek Anderson <derek@upshot.xyz>
  • Loading branch information
dmikey authored Mar 19, 2024
1 parent 17af8bb commit 1e1267e
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release_binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This workflow is useful if you want to automate the process of:
#
# a) Creating a new prelease when you push a new tag with a "v" prefix (version).
#
# This type of prerelease is meant to be used for production: alpha, beta, rc, etc. types of releases.
# After the prerelease is created, you need to make your changes on the release page at the relevant
# Github page and publish your release.
#
# b) Creating/updating the "latest" prerelease when you push to your default branch.
#
# This type of prelease is useful to make your bleeding-edge binaries available to advanced users.
#
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
# default branch.
on: push

jobs:
might_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Prepare Release Variables
id: vars
uses: ignite/cli/actions/release/vars@main

- name: Issue Release Assets
if: ${{ steps.vars.outputs.should_release == 'true' }}
run: |
GOOS=darwin GOARCH=arm64 go build -o release/darwin_arm64/allorad cmd/allorad/main.go
GOOS=darwin GOARCH=amd64 go build -o release/darwin_amd64/allorad cmd/allorad/main.go
GOOS=linux GOARCH=arm64 go build -o release/linux_arm64/allorad cmd/allorad/main.go
GOOS=linux GOARCH=amd64 go build -o release/linux_amd64/allorad cmd/allorad/main.go
GOOS=windows GOARCH=arm64 go build -o release/windows_arm64/allorad.exe cmd/allorad/main.go
GOOS=windows GOARCH=amd64 go build -o release/windows_amd64/allorad.exe cmd/allorad/main.go
- name: Delete the "latest" Release
uses: dev-drprasad/delete-tag-and-release@v0.2.1
if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }}
with:
tag_name: ${{ steps.vars.outputs.tag_name }}
delete_release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish the Release
uses: softprops/action-gh-release@v1
if: ${{ steps.vars.outputs.should_release == 'true' }}
with:
tag_name: ${{ steps.vars.outputs.tag_name }}
files: release/*
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1e1267e

Please sign in to comment.