name: Plugin Release on: workflow_dispatch: inputs: version: description: 'Plugin version to release, for example 6.2.0' required: true type: string permissions: contents: write jobs: release: runs-on: ubuntu-latest env: RELEASE_VERSION: ${{ inputs.version }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v5 with: python-version: '3.11' - name: Validate release metadata run: | python webnovel-writer/scripts/sync_plugin_version.py \ --check \ --expected-version "$RELEASE_VERSION" - name: Validate release notes run: | python webnovel-writer/scripts/validate_release_notes.py \ --version "$RELEASE_VERSION" - name: Validate plugin package run: python webnovel-writer/scripts/validate_plugin_package.py - name: Create and push tag run: | if git rev-parse "v$RELEASE_VERSION" >/dev/null 2>&1; then echo "Tag v$RELEASE_VERSION already exists" exit 1 fi echo "Releasing commit $(git rev-parse HEAD) as v$RELEASE_VERSION" git tag "v$RELEASE_VERSION" git push origin "v$RELEASE_VERSION" - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: tag_name: v${{ inputs.version }} name: v${{ inputs.version }} body_path: releases/v${{ inputs.version }}.md