Updated ubuntu version for github workflows #20
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired heavily by sample action yaml file on: | |
# https://github.com/actions/upload-release-asset | |
name: Prepare release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
create_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/create-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: "Bugout Go client - ${{ github.ref }}" | |
body: | | |
Version ${{ github.ref }} of the Bugout Go client library and command line tool | |
draft: true | |
prerelease: false | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
upload_assets: | |
runs-on: ubuntu-latest | |
needs: create_release | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ["linux", "darwin", "windows"] | |
arch: ["386", "amd64", "arm"] | |
exclude: | |
- os: "darwin" | |
arch: "arm" | |
- os: "darwin" | |
arch: "386" | |
- os: "windows" | |
arch: "arm" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.15.6 | |
- name: Build binary for each valid (GOOS, GOARCH) pair | |
env: | |
GOOS: ${{ matrix.os }} | |
GOARCH: ${{ matrix.arch }} | |
run: | | |
BUILD_DIR="bugout-${GOOS}-${GOARCH}" | |
mkdir "$BUILD_DIR" | |
cp README.md "$BUILD_DIR/README.md" | |
go build -o "$BUILD_DIR/bugout" cmd/bugout/main.go | |
zip -r "$BUILD_DIR.zip" "$BUILD_DIR" | |
- name: Upload release asset for each valid (GOOS, GOARH) pair | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: ./bugout-${{ matrix.os }}-${{ matrix.arch }}.zip | |
asset_name: bugout-${{ matrix.os }}-${{ matrix.arch }}.zip | |
asset_content_type: application/zip |