release #1
This file contains hidden or 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: release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g. 1.2.3)' | |
| required: true | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: update version in build.gradle.kts | |
| shell: bash | |
| run: sed -i 's/^version = .*/version = "${{ github.event.inputs.version }}"/' build.gradle.kts | |
| - name: commit, tag and push | |
| shell: bash | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add build.gradle.kts | |
| git commit -m "release: ${{ github.event.inputs.version }} [skip ci]" | |
| git tag "v${{ github.event.inputs.version }}" | |
| git push origin main --tags | |
| publish: | |
| needs: prepare | |
| uses: ./.github/workflows/publish.yml | |
| secrets: inherit | |
| github-release: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: create GitHub release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release create "v${{ github.event.inputs.version }}" --generate-notes --title "v${{ github.event.inputs.version }}" |