Skip to content

Commit

Permalink
Merge pull request #554 from k1LoW/fix-cd
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW authored Jan 25, 2024
2 parents 790d7e1 + 0f4b819 commit ffd9540
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/tagpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Run tagpr
uses: Songmu/tagpr@v1

darwin-release:
darwin-assets:
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: macos-latest
Expand All @@ -43,14 +43,18 @@ jobs:

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

linux-release:
linux-assets:
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: ubuntu-latest
Expand Down Expand Up @@ -101,7 +105,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

windows-release:
windows-assets:
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: windows-2019
Expand Down Expand Up @@ -196,3 +200,12 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.latest_version.outputs.version }}
org.opencontainers.image.source=https://github.com/k1LoW/tbls
release:
needs: [tagpr, darwin-assets, linux-assets, windows-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/darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ changelog:
exclude:
- '^docs:'
- '^test:'
release:
draft: true
replace_existing_draft: true
3 changes: 3 additions & 0 deletions .goreleaser/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ nfpms:
- apk
bindir: /usr/bin
epoch: 1
release:
draft: true
replace_existing_draft: true
3 changes: 3 additions & 0 deletions .goreleaser/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ changelog:
exclude:
- '^docs:'
- '^test:'
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
command = "make prerelease_for_tagpr"
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,4 @@ prerelease_for_tagpr: depsdev
gocredits -w .
git add CHANGELOG.md CREDITS go.mod go.sum

release_darwin:
goreleaser --config .goreleaser/darwin.yml --clean

.PHONY: default test

0 comments on commit ffd9540

Please sign in to comment.