-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
make release
and Github Action to auto-release packages with …
…each version.
- Loading branch information
1 parent
dc7089e
commit cc25dbc
Showing
4 changed files
with
96 additions
and
15 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
on: | ||
release: | ||
types: [published] | ||
|
||
name: Build Assets for Release Tag | ||
|
||
jobs: | ||
build: | ||
name: Upload Asset to Release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [ 'linux', 'freebsd', 'windows', 'darwin' ] | ||
architecture: [ 'amd64' ] | ||
include: | ||
- platform: linux | ||
architecture: arm | ||
- platform: linux | ||
architecture: arm64 | ||
steps: | ||
- name: Set up timezone | ||
uses: zcong1993/[email protected] | ||
with: | ||
timezone: America/Los_Angeles | ||
|
||
- name: Set up Golang | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
id: go | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build asset | ||
env: | ||
GOOS: ${{ matrix.platform }} | ||
GOARCH: ${{ matrix.architecture }} | ||
run: make release | ||
|
||
- name: Get release | ||
id: get-release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload zip asset | ||
id: upload-release-zip-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get-release.outputs.upload_url }} | ||
asset_path: ./release/gnmi-gateway-${{ steps.get-release.outputs.tag_name }}-${{ matrix.platform }}-${{ matrix.architecture }}.zip | ||
asset_name: gnmi-gateway-${{ steps.get-release.outputs.tag_name }}-${{ matrix.platform }}-${{ matrix.architecture }}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Upload sha256 asset | ||
id: upload-release-sha256-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get-release.outputs.upload_url }} | ||
asset_path: ./release/gnmi-gateway-${{ steps.get-release.outputs.tag_name }}-${{ matrix.platform }}-${{ matrix.architecture }}.zip.sha256 | ||
asset_name: gnmi-gateway-${{ steps.get-release.outputs.tag_name }}-${{ matrix.platform }}-${{ matrix.architecture }}.zip.sha256 | ||
asset_content_type: text/plain |
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
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