From 7ff293f3f87887072f13349f5085bdfa5a3454f7 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 | 34 ++++++++++++++++++++-------------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0f4618a5..55038afe 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 ad9d9e20..2dbbc0cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,24 +6,12 @@ on: permissions: contents: read jobs: - release: + release_and_publish: permissions: contents: write pull-requests: read runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v5 - with: - cache: pip - python-version: '3.10' - - name: Install dependencies - 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 @@ -32,11 +20,29 @@ jobs: # 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) - 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 }}