Trigger Release #7
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: Trigger Release | |
on: | |
workflow_dispatch: | |
inputs: | |
newVersion: | |
description: "New Version" | |
required: true | |
jobs: | |
archive: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
token: ${{ secrets.BOT_TOKEN }} | |
persist-credentials: false | |
- name: Setup Python environment | |
uses: ./.github/actions/setup-python | |
- name: Set New Version | |
run: | | |
OLD_VERSION=`cat ./pyproject.toml | grep ^version | cut -d '"' -f 2` | |
OLD_VERSION="\"$OLD_VERSION\"" | |
NEW_VERSION="\"${{ github.event.inputs.newVersion }}\"" | |
sed -i "s+version = $OLD_VERSION+version = $NEW_VERSION+g" ./pyproject.toml | |
echo "TAG_NAME=v$(pdm show --version)" >> $GITHUB_ENV | |
- name: Archive Changelog | |
uses: docker://ghcr.io/nonebot/auto-changelog:master | |
with: | |
archive_regex: '(?<=## )最近更新(?=\n)' | |
archive_title: ${{ env.TAG_NAME }} | |
commit_and_push: false | |
- name: Push Tag | |
run: | | |
git config user.name BotLunacub | |
git config user.email [email protected] | |
git remote set-url origin https://${{ secrets.GH_PAT }}@github.com/GuGuMur/nonebot-plugin-skland-arksign.git | |
git add . | |
git commit -m ":bookmark: Release $(pdm show --version)" | |
git tag ${{ env.TAG_NAME }} | |
git push -f && git push -f --tags |