Skip to content

Commit

Permalink
Implement automated release process
Browse files Browse the repository at this point in the history
  • Loading branch information
kchiranjewee63 committed Aug 7, 2024
1 parent bcdc952 commit c3dcbb0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/version-build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Version, Build, and Publish
name: Version, Build, Publish, Tag, and Release

on:
push:
Expand Down Expand Up @@ -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
Expand All @@ -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 "[email protected]"
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
Expand Down Expand Up @@ -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 }}
3 changes: 1 addition & 2 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator"
"@semantic-release/commit-analyzer"
]
}

0 comments on commit c3dcbb0

Please sign in to comment.