Skip to content

Commit

Permalink
try multiple binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucretius committed May 1, 2020
1 parent 6299ad2 commit c6670d6
Showing 1 changed file with 83 additions and 4 deletions.
87 changes: 83 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:

name: Build
jobs:
release-linux-amd64:
container:
compile-linux-amd64:
name: release linux/amd64
runs-on: ubuntu-latest
steps:
Expand All @@ -17,13 +16,73 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: compile and release linux amd64
- name: compile linux amd64
env:
GOARCH: amd64
GOOS: linux
run: |
go get -v ./...
go build -o vault_raft_snapshot_agent_linux_amd64
- name: Upload amd64 binary
uses: actions/upload-artifact@v1
with:
name: binaries
path: vault_raft_snapshot_agent_linux_amd64
compile-linux-arm64:
name: release linux/arm64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: compile arm64
env:
GOARCH: arm64
GOOS: linux
run: |
go get -v ./...
go build -o vault_raft_snapshot_agent_linux_arm64
- name: Upload arm64 binary
uses: actions/upload-artifact@v1
with:
name: binaries
path: vault_raft_snapshot_agent_linux_arm64
compile-linux-arm:
name: release linux/arm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: compile arm
env:
GOARCH: arm
GOOS: linux
run: |
go get -v ./...
go build -o vault_raft_snapshot_agent_linux_arm
- name: Upload arm binary
uses: actions/upload-artifact@v1
with:
name: binaries
path: vault_raft_snapshot_agent_linux_arm
create-release:
needs: [compile-linux-amd64, compile-linux-arm64, compile-linux-arm]
name: release linux/amd64
runs-on: ubuntu-latest
steps:
- name: Download binaries from earlier jobs
uses: actions/download-artifact@v1
with:
name: binaries
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -41,6 +100,26 @@ jobs:
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: ./vault_raft_snapshot_agent_linux_amd64
asset_path: binaries/vault_raft_snapshot_agent_linux_amd64
asset_name: vault_raft_snapshot_agent_linux_amd64
asset_content_type: application/octet-stream
- 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: binaries/vault_raft_snapshot_agent_linux_arm64
asset_name: vault_raft_snapshot_agent_linux_arm64
asset_content_type: application/octet-stream
- 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: binaries/vault_raft_snapshot_agent_linux_arm
asset_name: vault_raft_snapshot_agent_linux_arm
asset_content_type: application/octet-stream

0 comments on commit c6670d6

Please sign in to comment.