Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
remove(build): Use bazel for release bundles (#39)
Browse files Browse the repository at this point in the history
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
rtkjbeverly authored May 5, 2021
1 parent 940b43b commit bdaf0f0
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 56 deletions.
89 changes: 83 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
20 changes: 0 additions & 20 deletions .github/workflows/release.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .goreleaser.yml

This file was deleted.

2 changes: 1 addition & 1 deletion console/AppleScript.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (r AppleScriptConsole) Option(message string, prompt string, options []stri

listOptions := mack.ListOptions{
Items: options,
Title: fmt.Sprintf("BMX Option Prompt: %s", message),
Title: fmt.Sprintf("BMX Option Prompt: %s", message),
Message: prompt,
}
response, didCancel, err := mack.ListWithOpts(listOptions)
Expand Down
10 changes: 5 additions & 5 deletions console_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ func TestFindAppByLabels(t *testing.T) {
}

dataset := []okta.OktaAppLink{
okta.OktaAppLink{Label: "awsAppTesting1"},
okta.OktaAppLink{Label: "myTestApp2"},
okta.OktaAppLink{Label: "testingForAws"},
okta.OktaAppLink{Label: "MyAwsApp"},
okta.OktaAppLink{Label: "NotAnAwsApp"},
{Label: "awsAppTesting1"},
{Label: "myTestApp2"},
{Label: "testingForAws"},
{Label: "MyAwsApp"},
{Label: "NotAnAwsApp"},
}

for _, test := range expectedLabels {
Expand Down

0 comments on commit bdaf0f0

Please sign in to comment.