mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-26 17:51:34 +03:00
workflow: should now publish custom release notes to GH releases
This commit is contained in:
parent
d8993c9a30
commit
e72c0978f4
14
.generate-changelog-delta.sh
Executable file
14
.generate-changelog-delta.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This script the per-release changelog file for goreleaser to use
|
||||||
|
# to publish to GitHub releases.
|
||||||
|
curTag=$(git tag --sort=-creatordate | head -n 1)
|
||||||
|
prevTag=$(git tag --sort=-creatordate | head -n 2 | tail -n 1)
|
||||||
|
git diff "$prevTag" "$curTag" --no-ext-diff --unified=0 --exit-code -a --no-prefix -- ./CHANGELOG.md \
|
||||||
|
| grep -E "^\+" | grep -v '+++ CHANGELOG.md' | cut -c 2-
|
||||||
|
|
||||||
|
echo '### Commits'
|
||||||
|
|
||||||
|
echo '```text'
|
||||||
|
git log --pretty=format:'%h %s%n' "$prevTag".."$curTag"
|
||||||
|
echo '```'
|
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@ -235,12 +235,15 @@ jobs:
|
|||||||
name: dist-windows
|
name: dist-windows
|
||||||
path: dist-windows
|
path: dist-windows
|
||||||
|
|
||||||
|
- name: Generate CHANGELOG delta for Goreleaser to consume
|
||||||
|
run: ./.generate-changelog-delta.sh > ./.CHANGELOG.delta.md
|
||||||
|
|
||||||
- name: GoReleaser (publish)
|
- name: GoReleaser (publish)
|
||||||
uses: goreleaser/goreleaser-action@v3
|
uses: goreleaser/goreleaser-action@v3
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser-pro
|
distribution: goreleaser-pro
|
||||||
version: ${{ env.GORELEASER_VERSION }}
|
version: ${{ env.GORELEASER_VERSION }}
|
||||||
args: release -f .goreleaser.yml
|
args: release --release-notes=./.CHANGELOG.delta.md -f .goreleaser.yml
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -52,3 +52,4 @@ goreleaser-test.sh
|
|||||||
/manpages
|
/manpages
|
||||||
/cli/test.db
|
/cli/test.db
|
||||||
/*.db
|
/*.db
|
||||||
|
/.CHANGELOG.delta.md
|
||||||
|
Loading…
Reference in New Issue
Block a user