Skip to content

Commit

Permalink
ci(release): Separate jobs with tagpr and others (#160)
Browse files Browse the repository at this point in the history
Skip the release job entirely.
  • Loading branch information
5ouma authored Oct 27, 2024
1 parent 655bf94 commit c85e834
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ on:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
Release:
tagpr:
name: 🏷️ Release a New Version
permissions:
contents: write
pull-requests: write
runs-on: Ubuntu-Latest
outputs:
tag: ${{ steps.tagpr.outputs.tag }}

steps:
- name: 🚚 Checkout Repository
Expand All @@ -24,14 +26,24 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
name: πŸš€ Build and Release
permissions:
contents: write
needs: tagpr
if: ${{ needs.tagpr.outputs.tag != '' }}
runs-on: Ubuntu-Latest

steps:
- name: 🚚 Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: 🐹 Setup Go
if: ${{ steps.tagpr.outputs.tag != '' }}
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: go.mod

- name: πŸ’³ Create GitHub App Token
if: ${{ steps.tagpr.outputs.tag != '' }}
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
Expand All @@ -40,8 +52,7 @@ jobs:
owner: ${{ github.repository_owner }}
repositories: homebrew-formula

- name: πŸš€ Build and Rrelease with GoReleaser
if: ${{ steps.tagpr.outputs.tag != '' }}
- name: πŸš€ Build and Release with GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
args: release --clean --config=.github/goreleaser.yml
Expand Down

0 comments on commit c85e834

Please sign in to comment.