gavin/.github/workflows/go.yml
2021-01-23 07:30:35 -07:00

70 lines
1.9 KiB
YAML

name: Go
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Set up Node
uses: actions/setup-node@v2.1.4
with:
node-version: 12
- name: Install gover and Go 1.16beta1
run: go get suah.dev/gover && gover download 1.16beta1
- name: Clone Organice
run: git clone https://github.com/200ok-ch/organice organice_repo
- name: Build Organice
run: |
cd organice_repo
yarn install
yarn build
yarn cache clean
tar -czvf organice-$(date +"%Y-%m-%d").tar.gz build
- name: Copy Organice into gavin
run: cp -r organice_repo/build organice
- name: Build
run: |
for i in openbsd darwin linux; do
GOOS=${i} gover 1.16beta1 build -v -o gavin-${i}
tar -czvf gavin-${i}.tgz gavin-${i}
done
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./gavin-openbsd.tgz
asset_name: gavin-openbsd.tgz
asset_content_type: application/tar+gzip