docs(readme): describe the plugin and the bridge #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: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify: | |
| name: Verify release | |
| uses: ./.github/workflows/build.yml | |
| release: | |
| name: Cut release | |
| needs: verify | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| revision: ${{ steps.version.outputs.revision }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| # year.build, resetting the build number when the year changes. | |
| - name: Bump version | |
| id: version | |
| run: | | |
| CURRENT_YEAR="$(date +%y)" | |
| CURRENT="$(sed -n 's|^version=||p' gradle.properties)" | |
| YEAR="${CURRENT%%.*}" | |
| BUILD="${CURRENT##*.}" | |
| if [[ "$YEAR" != "$CURRENT_YEAR" ]]; then | |
| YEAR="$CURRENT_YEAR" | |
| BUILD=0 | |
| fi | |
| BUILD=$((BUILD + 1)) | |
| REVISION="$YEAR.$BUILD" | |
| sed -i "s|^version=.*|version=$REVISION|" gradle.properties | |
| # Badge and the version users copy out of the install snippet. | |
| sed -i \ | |
| -e "s|version-[^-]*-blue|version-$REVISION-blue|" \ | |
| -e "s|id(\"net.blueva.mawu\") version \"[^\"]*\"|id(\"net.blueva.mawu\") version \"$REVISION\"|" \ | |
| README.md | |
| echo "revision=$REVISION" >> "$GITHUB_OUTPUT" | |
| echo "Releasing Mawu $REVISION" | |
| # Pushes made with GITHUB_TOKEN don't retrigger this workflow, so | |
| # [skip ci] is just extra insurance. | |
| - name: Commit version bump | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add gradle.properties README.md | |
| git commit -m "build(release): bump version to ${{ steps.version.outputs.revision }} [skip ci]" | |
| git push | |
| - name: Tag release | |
| run: | | |
| git tag "v${{ steps.version.outputs.revision }}" | |
| git push origin "v${{ steps.version.outputs.revision }}" | |
| - name: Publish GitHub release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release create "v${{ steps.version.outputs.revision }}" --title "Mawu ${{ steps.version.outputs.revision }}" --generate-notes |