Skip to content

Instantly share code, notes, and snippets.

@egeneralov
Created November 15, 2019 19:49
Show Gist options
  • Select an option

  • Save egeneralov/87614c8c4e458e5e973bd6bb27819a62 to your computer and use it in GitHub Desktop.

Select an option

Save egeneralov/87614c8c4e458e5e973bd6bb27819a62 to your computer and use it in GitHub Desktop.
on:
push:
tags:
- 'v*'
name: Release
jobs:
build:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: build linux
run: GOOS=linux go build -v -o PROJECT_NAME_HERE-linux .
- name: build darwin
run: GOOS=darwin go build -v -o PROJECT_NAME_HERE-darwin .
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: save linux artifact in Actions
uses: actions/[email protected]
with:
name: linux
path: PROJECT_NAME_HERE-linux
- name: save darwin artifact in Actions
uses: actions/[email protected]
with:
name: darwin
path: PROJECT_NAME_HERE-darwin
- name: upload linux release asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./PROJECT_NAME_HERE-linux
asset_name: linux
asset_content_type: application/binary
- name: upload darwin release asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./PROJECT_NAME_HERE-darwin
asset_name: darwin
asset_content_type: application/binary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment