Deploy #4
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: Deploy | |
on: | |
workflow_dispatch: | |
inputs: | |
version_type: | |
description: "The type of the release version." | |
required: true | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
- alpha | |
increment: | |
description: "Whether to increment the version before release." | |
type: boolean | |
default: true | |
permissions: | |
contents: write | |
actions: write | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Update Version | |
id: update-version | |
run: | | |
output=$(python scripts/deploy/update_version.py ${{ inputs.version_type }} ${{ inputs.increment }}) | |
echo "VERSION=$output" >> $GITHUB_OUTPUT | |
# - name: Generate Changelogs | |
# run: | | |
# pip install .[dev.changelog] | |
# towncrier build --yes | |
# python scripts/deploy/populate_changelog.py CHANGES.md docs/source/changelogs/v3-changelog.md | |
# rm fragments/*.md | |
- name: Commit Changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Bump version" | |
file_pattern: "build.gradle.kts" | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Publish Plugin | |
env: | |
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }} | |
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }} | |
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} | |
run: ./gradlew publishPlugin | |
- name: Create Tag | |
run: | | |
git tag ${{ steps.update-version.outputs.VERSION }} | |
git push origin ${{ steps.update-version.outputs.VERSION }} | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
name: "v${{ steps.update-version.outputs.VERSION }}" | |
tag_name: "refs/tags/${{ steps.update-version.outputs.VERSION }}" | |
# body_path: CHANGES.md | |
prerelease: ${{ inputs.version_type == 'alpha' }} | |
files: build/distributions/hikari-lightbulb-support-${{ steps.update-version.outputs.VERSION }}.zip |