Skip to content

Commit

Permalink
Merge pull request #105 from k1LoW/fix-cd
Browse files Browse the repository at this point in the history
Fix CD pipeline
  • Loading branch information
k1LoW authored Jan 26, 2024
2 parents d90afb1 + 729a7bb commit 428f632
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/tagpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
major_version_tag_only: true
tag: ${{ steps.run-tagpr.outputs.tag }}

release:
assets:
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: macos-latest
Expand All @@ -49,13 +49,14 @@ jobs:
go-version-file: go.mod
cache: true

- name: Setup goreleaser
run: |
brew install goreleaser
- name: Release
run: |
make release
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dockerimage:
needs: tagpr
Expand Down Expand Up @@ -104,3 +105,13 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.latest_version.outputs.version }}
org.opencontainers.image.source=https://github.com/k1LoW/gh-setup
release:
needs: [tagpr, assets, dockerimage]
runs-on: ubuntu-latest
steps:
- name: Release
run: |
gh api /repos/${{ github.repository }}/releases/generate-notes -f tag_name=${{ needs.tagpr.outputs.tagpr-tag }} --jq .body | gh release edit ${{ needs.tagpr.outputs.tagpr-tag }} --repo ${{ github.repository }} --draft=false --latest --notes-file=-
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ nfpms:
- rpm
bindir: /usr/bin
epoch: 1
release:
draft: true
replace_existing_draft: true
1 change: 1 addition & 0 deletions .tagpr
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
[tagpr]
vPrefix = true
releaseBranch = main
release = draft
versionFile = version/version.go,action.yml
command = "make prerelease_for_tagpr"

0 comments on commit 428f632

Please sign in to comment.