This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove(build): Use bazel for release bundles (#39)
Use the bazel builds for release bundles instead of relying on goreleaser to generate the files. This deprecates the old goreleaser way of creating release bundles in favour of using the compiled bazel releases. This does mean that checksums are no longer included with releases, and the goreleaser conventions are no longer applied to github releases.
- Loading branch information
1 parent
940b43b
commit bdaf0f0
Showing
5 changed files
with
89 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,19 +12,25 @@ on: | |
- "go.sum" | ||
|
||
jobs: | ||
test: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, windows-latest, macos-latest] | ||
runs-on: ${{ matrix.platform }} | ||
include: | ||
- os: ubuntu-latest | ||
TARGET: linux | ||
- os: windows-latest | ||
TARGET: windows | ||
- os: macos-latest | ||
TARGET: darwin | ||
timeout-minutes: 5 | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Format | ||
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi | ||
run: if [ "$(gofmt -l `find . -name '*.go' | grep -v vendor` 2>&1)" ]; then exit 1; fi | ||
if: matrix.os == 'ubuntu-latest' | ||
- name: Build | ||
run: bazel build //cmd/bmx:bmx | ||
|
@@ -38,5 +44,76 @@ jobs: | |
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: bmx-${{ matrix.platform }} | ||
path: artifacts/ | ||
name: bmx-${{ matrix.TARGET }} | ||
path: artifacts/ | ||
release: | ||
name: Create Github Release | ||
if: contains(github.ref, 'tags/') | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Output Release URL File | ||
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | ||
|
||
- name: Save Release URL File for publish | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: release_url | ||
path: release_url.txt | ||
publish: | ||
if: contains(github.ref, 'tags/') | ||
needs: [build, release] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
TARGET: linux | ||
- os: windows-latest | ||
TARGET: windows | ||
- os: macos-latest | ||
TARGET: darwin | ||
steps: | ||
- name: Load Release URL File from release job | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: release_url | ||
path: /tmp/release_url | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: bmx-${{ matrix.TARGET }} | ||
path: artifacts/ | ||
|
||
- name: Get Release File Name & Upload URL | ||
id: get_release_info | ||
run: | | ||
echo ::set-output name=file_name::${REPOSITORY_NAME##*/}-${TAG_REF_NAME##*/v} | ||
value=`cat /tmp/release_url/release_url.txt` | ||
echo ::set-output name=upload_url::$value | ||
env: | ||
TAG_REF_NAME: ${{ github.ref }} | ||
REPOSITORY_NAME: ${{ github.repository }} | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | ||
asset_path: ./artifacts/package.tar | ||
asset_name: ${{ steps.get_release_info.outputs.file_name }}-${{ matrix.TARGET }}.tar | ||
asset_content_type: application/zip |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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