From c3dcbb06d0d9715b3f95a7195198fcf1d37bc04c Mon Sep 17 00:00:00 2001 From: kchiranjewee63 Date: Wed, 7 Aug 2024 11:57:19 -0400 Subject: [PATCH] Implement automated release process --- .github/workflows/version-build-publish.yml | 29 +++++++++++++++++++-- .releaserc.json | 3 +-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/version-build-publish.yml b/.github/workflows/version-build-publish.yml index b67ea5b..419fdda 100644 --- a/.github/workflows/version-build-publish.yml +++ b/.github/workflows/version-build-publish.yml @@ -1,4 +1,4 @@ -name: Version, Build, and Publish +name: Version, Build, Publish, Tag, and Release on: push: @@ -28,7 +28,7 @@ jobs: - name: Install Dependencies run: | - npm install -g semantic-release @semantic-release/changelog @semantic-release/git + npm install -g semantic-release npm list -g semantic-release - name: Verify Installation @@ -48,6 +48,12 @@ jobs: if [ -n "$VERSION" ]; then echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV echo "New version: $VERSION" + + # Create and push tag + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git tag -a v$VERSION -m "Release $VERSION" + git push origin v$VERSION else echo "No new version to release" echo "RELEASE_VERSION=latest" >> $GITHUB_ENV @@ -77,3 +83,22 @@ jobs: ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }} ghcr.io/${{ github.repository }}:latest outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Tconfigd - Central daemon for distributing and managing Tratteria configurations + + - name: Create GitHub Release + if: env.RELEASE_VERSION != 'latest' + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ env.RELEASE_VERSION }} + name: Release ${{ env.RELEASE_VERSION }} + body: | + Release ${{ env.RELEASE_VERSION }} + + Docker images for this release: + - `ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}` + + For a detailed list of all changes, please refer to the automatically generated release notes below. + draft: false + prerelease: false + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.releaserc.json b/.releaserc.json index 9633d3f..b3735db 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -3,7 +3,6 @@ "main" ], "plugins": [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator" + "@semantic-release/commit-analyzer" ] } \ No newline at end of file