Storing bin files from action #3
This file contains 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
name: Go | ||
on: | ||
push: | ||
branches: [ maestro ] | ||
pull_request: | ||
branches: [ maestro ] | ||
jobs: | ||
build: | ||
if: github.actor != 'github-actions[bot]' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
go: ['1.18'] | ||
os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | ||
steps: | ||
- name: Check Out Code | ||
uses: actions/checkout@v2 | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Download Go modules | ||
run: go get -v -t -d ./... | ||
- name: Run Tests | ||
run: go test | ||
- name: Build | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: go build -v -o ./bin/hsa | ||
- name: Build | ||
if: startsWith(matrix.os, 'macos') | ||
run: go build -v -o ./bin/hsamac | ||
- name: Build | ||
if: startsWith(matrix.os, 'windows') | ||
run: go build -v -o ./bin/hsa.exe | ||
- name: Commit and Push Binaries (Ubuntu) | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add ./bin/hsa | ||
git commit -m "Add Ubuntu built binary [skip ci]" | ||
git push | ||
- name: Commit and Push Binaries (MacOS) | ||
if: startsWith(matrix.os, 'macos') | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add ./bin/hsamac | ||
git commit -m "Add MacOS built binary [skip ci]" | ||
git push | ||
- name: Commit and Push Binaries (Windows) | ||
if: startsWith(matrix.os, 'windows') | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add ./bin/hsa.exe | ||
git commit -m "Add Windows built binary [skip ci]" | ||
git push |