From 5dacd794597987e8a604c4c61c046a5ac76088ef Mon Sep 17 00:00:00 2001 From: Martin Montes Date: Thu, 28 Dec 2023 16:04:22 +0100 Subject: [PATCH] Bump goreleaser. Added release header and footer --- .github/workflows/release.yml | 24 +++++++++++++++++-- .../releases/RELEASE_v0.0.12_FOOTER.md.gotmpl | 1 + .../releases/RELEASE_v0.0.12_HEADER.md.gotmpl | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 docs/releases/RELEASE_v0.0.12_FOOTER.md.gotmpl create mode 100644 docs/releases/RELEASE_v0.0.12_HEADER.md.gotmpl diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 439879c..9c5b987 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,10 +18,30 @@ jobs: - name: Fetch tags run: git fetch --force --tags + - name: Prepare + id: prep + run: | + VERSION=sha-${GITHUB_SHA::8} + if [[ $GITHUB_REF == refs/tags/* ]]; then + VERSION=${GITHUB_REF/refs\/tags\//} + fi + RELEASE_ARGS=release + RELEASE_HEADER_TMPL=docs/releases/RELEASE_${VERSION}_HEADER.md.gotmpl + RELEASE_FOOTER_TMPL=docs/releases/RELEASE_${VERSION}_FOOTER.md.gotmpl + if [ -f "${RELEASE_HEADER_TMPL}" ]; then + RELEASE_ARGS="${RELEASE_ARGS} --release-header-tmpl=${RELEASE_HEADER_TMPL}" + fi + if [ -f "${RELEASE_FOOTER_TMPL}" ]; then + RELEASE_ARGS="${RELEASE_ARGS} --release-footer-tmpl=${RELEASE_FOOTER_TMPL}" + fi + echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT + echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT + echo "RELEASE_ARGS=${RELEASE_ARGS}" >> $GITHUB_OUTPUT + - name: GoReleaser - uses: goreleaser/goreleaser-action@v3 + uses: goreleaser/goreleaser-action@v4 with: version: latest - args: release + args: ${{ steps.prep.outputs.RELEASE_ARGS }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/releases/RELEASE_v0.0.12_FOOTER.md.gotmpl b/docs/releases/RELEASE_v0.0.12_FOOTER.md.gotmpl new file mode 100644 index 0000000..5cebcf9 --- /dev/null +++ b/docs/releases/RELEASE_v0.0.12_FOOTER.md.gotmpl @@ -0,0 +1 @@ +{{ .ProjectName }}📜 is licensed under [MIT](https://opensource.org/license/mit/). \ No newline at end of file diff --git a/docs/releases/RELEASE_v0.0.12_HEADER.md.gotmpl b/docs/releases/RELEASE_v0.0.12_HEADER.md.gotmpl new file mode 100644 index 0000000..9f58d10 --- /dev/null +++ b/docs/releases/RELEASE_v0.0.12_HEADER.md.gotmpl @@ -0,0 +1 @@ +Thank you for using {{ .ProjectName }}📜! This release contains multiple improvements and bugfixes. \ No newline at end of file