Actions Release CI #107
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
name: Actions Release CI | |
run-name: Actions Release CI | |
permissions: | |
contents: write | |
issues: read | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * 3' # this means every Wednesday @1am UTC | |
jobs: | |
pre_commit: | |
name: Pre-Commit | |
uses: ./.github/workflows/_pre_commit.yml | |
with: | |
pre-commit-hooks: checkov | |
release: | |
name: Semantic release | |
needs: | |
- pre_commit | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: sem release | |
id: rc | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
semantic_version: 19.0 | |
extra_plugins: | | |
conventional-changelog-conventionalcommits@^5.0.0 | |
@semantic-release/git@^10.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: create major release tag | |
if: steps.rc.outputs.new_release_published == 'true' | |
env: | |
MAJOR: ${{ steps.rc.outputs.new_release_major_version }} | |
MINOR: ${{ steps.rc.outputs.new_release_minor_version }} | |
RELEASE: ${{ steps.rc.outputs.new_release_version }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "github-bot" | |
git tag -f "v$MAJOR" "v$RELEASE" | |
git tag -f "v$MAJOR.$MINOR" "v$RELEASE" | |
git push origin "v$MAJOR" --force | |
git push origin "v$MAJOR.$MINOR" --force |