From 03b17db007701bb9ae68a0997cc0af15b8183a20 Mon Sep 17 00:00:00 2001 From: IndomieNoSleep <146687855+NTGNguyen@users.noreply.github.com> Date: Sat, 18 Jan 2025 13:32:25 +0700 Subject: [PATCH] ci: configure semantic release in GitHub Action (#51) --- .github/workflows/sematic-release.yml | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/sematic-release.yml diff --git a/.github/workflows/sematic-release.yml b/.github/workflows/sematic-release.yml new file mode 100644 index 0000000..29ee03a --- /dev/null +++ b/.github/workflows/sematic-release.yml @@ -0,0 +1,41 @@ +name: sematic-release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + concurrency: release + + permissions: + id-token: write + contents: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.sha }} + + - name: Setup | Force correct release branch on workflow sha + run: | + git checkout -B ${{ github.ref_name }} ${{ github.sha }} + - name: Update Semantic Version Release + id: release + uses: python-semantic-release/python-semantic-release@v9.16.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + git_committer_name: 'github-actions' + git_committer_email: 'actions@users.noreply.github.com' + changelog: 'false' + + - name: Upload to GitHub Release Assets + uses: python-semantic-release/publish-action@v9.16.1 + if: steps.release.outputs.released == 'true' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ steps.release.outputs.tag }}