From 1feacd39b21193de11e9bbecf880ddf96d7c261c Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:57:30 +0800 Subject: [PATCH] chore: release 0.0.1 Release-As: 0.0.1 --- .github/workflows/pr.yml | 2 +- .github/workflows/release.yml | 26 ++++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0f4618a59..55038afe4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,7 +7,7 @@ jobs: steps: - name: Check PR Title for Conventional Commit Format run: | - if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?:\s.*'; then + if ! echo "${{ github.event.pull_request.title }}" | grep -Pq '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|Release-As)(\(\w+\))?!?:\s.*'; then echo 'The title does not conform to the Conventional Commit.' echo 'Please refer to "https://www.conventionalcommits.org/"' exit 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad9d9e206..2dbbc0cfb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,37 +6,43 @@ on: permissions: contents: read jobs: - release: + release_and_publish: permissions: contents: write pull-requests: read runs-on: ubuntu-latest steps: + - name: Release please + id: release_please + uses: googleapis/release-please-action@v4 + with: + # The current PAT (personal access token) was created on 2024-08-05, + # since the maximum validity of PAT is 1 year, you need to change the PAT before 2025-08-05. + token: ${{ secrets.PAT }} + release-type: simple - uses: actions/checkout@v4 + if: ${{ steps.release_please.outputs.release_created }} with: fetch-depth: 0 - name: Set up Python + if: ${{ steps.release_please.outputs.release_created }} uses: actions/setup-python@v5 with: cache: pip python-version: '3.10' - name: Install dependencies + if: ${{ steps.release_please.outputs.release_created }} run: | python -m pip install --upgrade pip pip install setuptools wheel twine # better-exceptions(optional for debug) - - name: Release please - id: release_please - uses: googleapis/release-please-action@v4 - with: - # The current PAT (personal access token) was created on 2024-08-05, - # since the maximum validity of PAT is 1 year, you need to change the PAT before 2025-08-05. - token: ${{ secrets.PAT }} - release-type: simple - run: env | sort + if: ${{ steps.release_please.outputs.release_created }} - run: make dev + if: ${{ steps.release_please.outputs.release_created }} - run: make build + if: ${{ steps.release_please.outputs.release_created }} - name: upload - if: ${{ steps.release.outputs.release_created }} + if: ${{ steps.release_please.outputs.release_created }} env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}