Skip to content

Commit

Permalink
Merge pull request #124 from DireLines/main
Browse files Browse the repository at this point in the history
fix: try Justin's method of brew after release-please
  • Loading branch information
DireLines authored Feb 29, 2024
2 parents 19b3d97 + 696fc77 commit 7ec6356
Showing 1 changed file with 44 additions and 11 deletions.
55 changes: 44 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: release

on:
push:
tags:
- "*"
branches:
- main

permissions:
contents: write
Expand All @@ -16,12 +16,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: go
package-name: runpodctl
pull-request-title-pattern: release${component} ${version}

- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-go@v2
if: ${{ steps.release.outputs.release_created }}
with:
go-version: 1.17

- name: build
if: ${{ steps.release.outputs.release_created }}
run: |
env GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-linux-amd64 .
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-darwin-amd64 .
Expand All @@ -31,6 +41,7 @@ jobs:
# env GOOS=android GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ steps.release.outputs.tag_name }}'" -o bin/runpodctl-android-amd64 .
- name: upload linux amd64 release binary
if: ${{ steps.release.outputs.release_created }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -40,6 +51,7 @@ jobs:
asset_name: runpodctl-linux-amd64
asset_content_type: application/octet-stream
- name: upload darwin amd64 release binary
if: ${{ steps.release.outputs.release_created }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -50,6 +62,7 @@ jobs:
asset_content_type: application/octet-stream

- name: upload darwin arm64 release binary
if: ${{ steps.release.outputs.release_created }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -60,6 +73,7 @@ jobs:
asset_content_type: application/octet-stream

- name: upload windows amd64 release binary
if: ${{ steps.release.outputs.release_created }}
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -68,16 +82,8 @@ jobs:
asset_path: bin/runpodctl-windows-amd64.exe
asset_name: runpodctl-windows-amd64.exe
asset_content_type: application/octet-stream
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
ldflags: "-X 'main.Version=${{ steps.release.outputs.tag_name }}'"
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
# - name: upload linux arm64 release binary
# if: ${{ steps.release.outputs.release_created }}
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -87,6 +93,7 @@ jobs:
# asset_name: runpodctl-linux-arm64
# asset_content_type: application/octet-stream
# - name: upload android amd64 release binary
# if: ${{ steps.release.outputs.release_created }}
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ github.token }}
Expand All @@ -95,3 +102,29 @@ jobs:
# asset_path: bin/runpodctl-android-amd64
# asset_name: runpodctl-android-amd64
# asset_content_type: application/octet-stream

brew:
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout
if: ${{ needs.release.outputs.release_created }}
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
if: ${{ needs.release.outputs.release_created }}
uses: actions/setup-go@v4
with:
go-version: 1.17

- name: Run GoReleaser
if: ${{ needs.release.outputs.release_created }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

0 comments on commit 7ec6356

Please sign in to comment.