Skip to content

Commit

Permalink
fix: enhance release workflow with linting and semantic release confi…
Browse files Browse the repository at this point in the history
…guration (#29)

* fix: enhance release workflow with linting and semantic release configuration

* fix: remove linting job from release workflow
  • Loading branch information
naka-gawa authored Nov 28, 2024
1 parent 87f8856 commit 0b6b8f6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
34 changes: 26 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,45 @@
name: release

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

jobs:
determine_release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
outputs:
will_release: ${{ steps.determine_release.outputs.new_release_published }}
steps:
- uses: actions/checkout@v3
- id: determine_release
uses: cycjimmy/[email protected]
with:
dry_run: true
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}

release:
runs-on: ubuntu-latest
permissions:
contents: write # これがないとリリースを作成できない
contents: write
needs:
- determine_release
if: ${{ needs.determine_release.outputs.will_release }}
steps:
# チェックアウト
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Changelog を正しく動作させるために必要

# Go をセットアップ
fetch-depth: 0
- uses: cycjimmy/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ changelog:
exclude:
- "^docs:"
- "^test:"

release:
mode: keep-existing
8 changes: 8 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}

0 comments on commit 0b6b8f6

Please sign in to comment.