From 89b1173c1b65461fb16625c9c04694f152812d57 Mon Sep 17 00:00:00 2001 From: Xav Paice Date: Wed, 3 Dec 2025 18:44:49 +1300 Subject: [PATCH] add release workflow --- .github/workflows/release.yml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4f38b40 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,54 @@ +name: release + +on: + push: + tags: + - "v*.*.*" + +jobs: + create-release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate release notes + id: release-notes + run: | + PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") + if [ -z "$PREVIOUS_TAG" ]; then + # If no previous tag, get all commits since the beginning + CHANGELOG=$(git log --pretty=format:"- %s (%h)" --no-merges) + else + # Get commits since the previous tag + CHANGELOG=$(git log ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges) + fi + + NOTES="## Changes in ${{ github.ref_name }} + + $CHANGELOG + + ### Installation + + Use this version in your workflows: + + \`\`\`yaml + uses: replicatedhq/replicated-actions/ACTION_NAME@${{ github.ref_name }} + \`\`\`" + + echo "notes<> $GITHUB_OUTPUT + echo "$NOTES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref_name }} + name: Release ${{ github.ref_name }} + body: ${{ steps.release-notes.outputs.notes }} + draft: false + prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }} +