Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
pull_request:
branches: [ main ]
workflow_call:
inputs:
checkout-ref:
Comment thread
yejseo01 marked this conversation as resolved.
description: Git ref to check out when this workflow is called by another workflow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What workflow will call this workflow?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release.yml in this repo!

required: false
type: string
default: ''

concurrency:
group: ci-${{ github.head_ref || github.run_id }}
Expand All @@ -17,6 +23,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
ref: ${{ inputs.checkout-ref || github.ref }}

- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
Expand Down Expand Up @@ -46,6 +54,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
ref: ${{ inputs.checkout-ref || github.ref }}

- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ on:
push:
tags:
- v[0-9].[0-9]+.[0-9]+
workflow_dispatch:
inputs:
release-tag:
description: Release tag, for example v1.2.3
required: true
type: string
pre-release:
description: Pre-release
required: false
type: boolean
default: false

concurrency:
group: release-${{ github.head_ref || github.run_id }}
Expand All @@ -15,22 +26,38 @@ permissions:
jobs:
ci:
uses: ./.github/workflows/ci.yml
with:
checkout-ref: ${{ inputs['release-tag'] || github.ref }}
secrets: inherit

release:
needs: ci
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
fetch-depth: 0
ref: ${{ inputs['release-tag'] || github.ref }}
Comment thread
yejseo01 marked this conversation as resolved.
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
with:
go-version-file: 'go.mod'
- name: Configure GoReleaser release type
env:
PRE_RELEASE: ${{ inputs['pre-release'] || false }}
run: |
cp .goreleaser.yaml .goreleaser.release.yaml
Comment thread
yejseo01 marked this conversation as resolved.
Outdated
if [ "$PRE_RELEASE" = "true" ]; then
{
printf '\n'
printf 'release:\n'
printf ' prerelease: true\n'
} >> .goreleaser.release.yaml
fi
- uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
args: release --clean --config .goreleaser.release.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ inputs['release-tag'] || github.ref_name }}
Loading