-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added semantic release to the CI pipeline. (#21)
This PR adds semantic release to the CI pipeline, which creates a semantic version number, tags the repo, and publishes a release to GitHub.
- Loading branch information
1 parent
775aac3
commit 619b00a
Showing
11 changed files
with
259 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
|
@@ -65,7 +65,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
|
@@ -107,3 +107,28 @@ jobs: | |
- name: Run Trivy Scan | ||
run: trivy filesystem --security-checks vuln,config --exit-code 1 --severity HIGH,CRITICAL --ignore-unfixed . | ||
|
||
publishing: | ||
name: Publish Release | ||
runs-on: ubuntu-latest | ||
needs: [build-verification, static-code-analysis] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false # Disable default GITHUB_TOKEN persistence | ||
|
||
- name: Create Semantic Release | ||
uses: cycjimmy/[email protected] | ||
id: semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
|
||
- name: Output Release Details | ||
if: steps.semantic-release.outputs.new_release_published == 'true' | ||
run: | | ||
echo ${{ steps.semantic-release.outputs.new_release_version }} | ||
echo ${{ steps.semantic-release.outputs.new_release_major_version }} | ||
echo ${{ steps.semantic-release.outputs.new_release_minor_version }} | ||
echo ${{ steps.semantic-release.outputs.new_release_patch_version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"branches": [ | ||
"main" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github" | ||
], | ||
"releaseRules": [ | ||
{ "breaking": true, "release": "major" }, | ||
{ "revert": true, "release": "patch" }, | ||
{ "type": "feat", "release": "minor" }, | ||
{ "message": "**", "release": "patch" } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.