Skip to content

Commit

Permalink
ci: add release confirm checkbox for manual run
Browse files Browse the repository at this point in the history
  • Loading branch information
nikaro committed May 24, 2024
1 parent e835b19 commit 7300ccb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

15 changes: 11 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
schedule:
- cron: "0 0 * * 3"
workflow_dispatch:
inputs:
confirm:
description: Confirm
type: boolean
required: true

jobs:
ci:
Expand Down Expand Up @@ -36,28 +41,30 @@ jobs:
dry_run: true

- name: Bump
if: github.event_name == 'pull_request' && inputs.confirm
id: cz
uses: commitizen-tools/commitizen-action@1f11eb222996406681d2bfa1eb3d997eca46557c # 0.21.0
with:
github_token: ${{ github.token }}
changelog_increment_filename: _changelog.md

- name: Check if version bumped
if: steps.cz.outputs.version
id: check-tag
run: |
[ "${{ steps.latest-tag.outputs.tag }}" != "${{ steps.cz.outputs.version }}" ] && bump=true
echo "bump=$bump" >> "$GITHUB_OUTPUT"
[ "${{ steps.latest-tag.outputs.tag }}" != "${{ steps.cz.outputs.version }}" ] && \
echo bump=true >> "$GITHUB_OUTPUT"
- name: Setup Go
if: steps.check-tag.outputs.bump == 'true'
if: steps.check-tag.outputs.bump
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
cache: true
check-latest: true
go-version-file: go.mod

- name: Run GoReleaser
if: steps.check-tag.outputs.bump == 'true'
if: steps.check-tag.outputs.bump
uses: goreleaser/goreleaser-action@5742e2a039330cbb23ebf35f046f814d4c6ff811 # v5.1.0
with:
args: release --clean --release-notes _changelog.md
Expand Down

0 comments on commit 7300ccb

Please sign in to comment.