Skip to content

chore: re-run release v0.1.0 #2

chore: re-run release v0.1.0

chore: re-run release v0.1.0 #2

Workflow file for this run

name: Release
on:
push:
branches: [main]
paths: ["CHANGELOG.md"]
permissions: write-all
jobs:
release:
runs-on: ubuntu-latest
env:
GO_VERSION: "1.23.0"
steps:
- uses: Kesin11/actions-timeline@v2
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: go.sum
- name: Extract Version
id: versioning
run: |
VERSION="v$(sed -n 's/##\s\([0-9.]*\)\s.*/\1/p' CHANGELOG.md | head -1)"
echo ::set-output name=version::$VERSION
- name: Extract changes from prev version
run: |
git fetch --prune --unshallow
PRETAG=$(git tag --sort -v:refname | head -1)
CURRENTTAG=${{ steps.versioning.outputs.version }}
echo "## What's Changed in ${CURRENTTAG}" > /tmp/diff-changelog.md
if [ -z "$PRETAG" ]
then
cat CHANGELOG.md | sed -e 's/##\s[0-9.]*\s.*//g' >> /tmp/diff-changelog.md
else
git diff $PRETAG..${{ github.sha }} -- CHANGELOG.md | grep -E '^\+' | grep -v '+++' | sed -e 's/^\+//g' | sed -e 's/##\s[0-9.]*\s.*//g' | sed -e '/^$/d' >> /tmp/diff-changelog.md
echo "" >> /tmp/diff-changelog.md
echo "**Full Changelog**: https://github.com/miyamo2/kubectl-create-transient_configmap /compare/${PRETAG}...${CURRENTTAG}" >> /tmp/diff-changelog.md
fi
- name: Push Tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag ${{ steps.versioning.outputs.version }}
git push origin ${{ steps.versioning.outputs.version }}
- uses: goreleaser/goreleaser-action@v6
with:
workdir: .github/
version: latest
args: release --clean --release-notes=/tmp/diff-changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}