gavin/.github/workflows/go.yml

137 lines
4.1 KiB
YAML

name: Go
on:
push:
tags:
- 'v*'
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-assets.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
for a in amd64 arm64; do
GOOS=${i} GOARCH=${a} gover 1.16beta1 build -v -o gavin-${i}-${a}
tar -czvf gavin-${i}-${a}.tgz gavin-${i}-${a}
done
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 Gavin for OpenBSD-amd64
id: upload-gavin-openbsd-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gavin-openbsd-amd64.tgz
asset_name: gavin-openbsd-amd64.tgz
asset_content_type: application/tar+gzip
- name: Upload Gavin for OpenBSD-arm64
id: upload-gavin-openbsd-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gavin-openbsd-arm64.tgz
asset_name: gavin-openbsd-arm64.tgz
asset_content_type: application/tar+gzip
- name: Upload Gavin for Linux-amd64
id: upload-gavin-linux-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gavin-linux-amd64.tgz
asset_name: gavin-linux-amd64.tgz
asset_content_type: application/tar+gzip
- name: Upload Gavin for Linux-arm64
id: upload-gavin-linux-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gavin-linux-arm64.tgz
asset_name: gavin-linux-arm64.tgz
asset_content_type: application/tar+gzip
- name: Upload Gavin for Darwin-amd64
id: upload-gavin-darwin-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gavin-darwin-amd64.tgz
asset_name: gavin-darwin-amd64.tgz
asset_content_type: application/tar+gzip
- name: Upload Gavin for Darwin-arm64
id: upload-gavin-darwin-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: gavin-darwin-arm64.tgz
asset_name: gavin-darwin-arm64.tgz
asset_content_type: application/tar+gzip
- name: Upload Organice Assets
id: upload-organice-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: organice-assets.tar.gz
asset_name: organice-assets.tar.gz
asset_content_type: application/tar+gzip