Merge changes to master --release #684
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: BlockBall | |
| permissions: | |
| contents: write | |
| # Controls when the action will run. | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the master branch | |
| push: | |
| branches: [ master, development ] | |
| pull_request: | |
| branches: [ master, development ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| # This workflow contains a single job called "build" | |
| Build: | |
| # The type of runner that the job will run on | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-java@v1 | |
| with: | |
| java-version: '8' | |
| - name: Build Java Application | |
| env: | |
| SHYNIXN_MCUTILS_REPOSITORY_2026: ${{ secrets.SHYNIXN_MCUTILS_REPOSITORY_2026 }} | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew build pluginJars | |
| echo "RELEASE_VERSION=$(./gradlew -q printVersion)" >> $GITHUB_ENV | |
| - name: Rename Artifacts | |
| if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')" | |
| env: | |
| GEYSER_PASSWORD: ${{ secrets.GEYSER_PASSWORD }} | |
| run: | | |
| mv ./build/libs/blockball-${{ env.RELEASE_VERSION }}-26.1.0-latest-premium-folia.jar ./BlockBall-26.1.0-latest-Premium-Folia.jar | |
| mv ./build/libs/blockball-${{ env.RELEASE_VERSION }}-1.17.0-1.21.11-premium-folia.jar ./BlockBall-1.17.0-1.21.11-Premium-Folia.jar | |
| mv ./build/libs/blockball-${{ env.RELEASE_VERSION }}-1.8.8-1.16.5-premium.jar ./BlockBall-1.8.8-1.16.5-Premium.jar | |
| mv ./build/libs/blockball-${{ env.RELEASE_VERSION }}-1.17.0-1.21.11-premium.jar ./BlockBall-1.17.0-1.21.11-Premium.jar | |
| mv ./build/libs/blockball-${{ env.RELEASE_VERSION }}-26.1.0-latest-premium.jar ./BlockBall-26.1.0-latest-Premium.jar | |
| 7z x docs/resources/BlockBall-GeyserMC.7z -p${{ env.GEYSER_PASSWORD }} | |
| - name: Parse Changelog | |
| if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')" | |
| run: | | |
| VERSION=${{ env.RELEASE_VERSION }} | |
| CHANGES=$(awk '/^---/{exit} /^## Release /{found=1; next} found{print}' CHANGELOG.md) | |
| FOOTER=$(cat docs/footer-github.md) | |
| FOOTER="${FOOTER//<version>/$VERSION}" | |
| PATREON_FOOTER_BASIC=$(cat docs/footer-patreon-basic.md) | |
| PATREON_FOOTER_ELITE=$(cat docs/footer-patreon-elite.md) | |
| BODY="$CHANGES"$'\n'"$FOOTER" | |
| PATREON_BODY_BASIC="$CHANGES"$'\n'"$PATREON_FOOTER_BASIC" | |
| PATREON_BODY_ELITE="$CHANGES"$'\n'"$PATREON_FOOTER_ELITE" | |
| echo "RELEASE_BODY<<EOF" >> $GITHUB_ENV | |
| echo "$BODY" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| echo "RELEASE_PATREON_BASIC<<EOF" >> $GITHUB_ENV | |
| echo "$PATREON_BODY_BASIC" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| echo "RELEASE_PATREON_ELITE<<EOF" >> $GITHUB_ENV | |
| echo "$PATREON_BODY_ELITE" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: Create Github Release | |
| if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')" | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| body: ${{ env.RELEASE_BODY }} | |
| tag_name: ${{ env.RELEASE_VERSION }} | |
| release_name: Release ${{ env.RELEASE_VERSION }} | |
| draft: true | |
| prerelease: false | |
| - name: Upload BlockBall-26.1.0-latest-Free.jar | |
| if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')" | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-${{ env.RELEASE_VERSION }}-26.1.0-latest-free.jar | |
| asset_name: BlockBall.jar | |
| asset_content_type: application/jar | |
| - name: Publish Patreon Release | |
| if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')" | |
| env: | |
| PAPOA_API_KEY: ${{ secrets.PAPOA_API_KEY }} | |
| PAPOA_PASSWORD: ${{ secrets.PAPOA_PASSWORD }} | |
| run: | | |
| wget -O papoa https://github.com/Shynixn/PatreonPostApi/releases/latest/download/papoa-linux-x64 | |
| chmod +x papoa | |
| ./papoa post create \ | |
| --title "BlockBall for Folia v${{ env.RELEASE_VERSION }} (1.8.9-26.2)" \ | |
| --content "$RELEASE_PATREON_ELITE" \ | |
| --content-format text/markdown \ | |
| --tier-name "Elite" \ | |
| --tier-name "Legendary" \ | |
| --collection-name "BlockBall" \ | |
| --tag blockball \ | |
| --tag minecraft \ | |
| --tag plugin \ | |
| --ttl-days 1 \ | |
| --file ./BlockBall-26.1.0-latest-Premium-Folia.jar \ | |
| --file ./BlockBall-1.17.0-1.21.11-Premium-Folia.jar \ | |
| --file /home/runner/work/BlockBall/BlockBall/docs/wiki/docs/assets/title.png \ | |
| --photo-attachment-file-name "title.png" \ | |
| --attachment-file-name "BlockBall-26.1.0-latest-Premium-Folia.jar" \ | |
| --attachment-file-name "BlockBall-1.17.0-1.21.11-Premium-Folia.jar" \ | |
| --password "$PAPOA_PASSWORD" | |
| ./papoa post create \ | |
| --title "BlockBall v${{ env.RELEASE_VERSION }} (1.8.9-26.2)" \ | |
| --content "$RELEASE_PATREON_BASIC" \ | |
| --content-format text/markdown \ | |
| --tier-name "Basic" \ | |
| --tier-name "Elite" \ | |
| --tier-name "Legendary" \ | |
| --collection-name "BlockBall" \ | |
| --tag blockball \ | |
| --tag minecraft \ | |
| --tag plugin \ | |
| --ttl-days 1 \ | |
| --file ./BlockBall-1.8.8-1.16.5-Premium.jar \ | |
| --file ./BlockBall-1.17.0-1.21.11-Premium.jar \ | |
| --file ./BlockBall-26.1.0-latest-Premium.jar \ | |
| --file ./BlockBall-GeyserMC.zip \ | |
| --file /home/runner/work/BlockBall/BlockBall/docs/wiki/docs/assets/title.png \ | |
| --photo-attachment-file-name "title.png" \ | |
| --attachment-file-name "BlockBall-1.8.8-1.16.5-Premium.jar" \ | |
| --attachment-file-name "BlockBall-1.17.0-1.21.11-Premium.jar" \ | |
| --attachment-file-name "BlockBall-26.1.0-latest-Premium.jar" \ | |
| --attachment-file-name "BlockBall-GeyserMC.zip" \ | |
| --password "$PAPOA_PASSWORD" | |
| Documentation: | |
| runs-on: ubuntu-22.04 | |
| if: "contains(github.ref, 'master')" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.x' | |
| architecture: 'x64' | |
| - name: Build Documentation | |
| run: | | |
| git pull | |
| git config --global user.email "shynixn@email.com" && git config --global user.name "Shynixn CI Actions" | |
| rm -rf docs/wiki/site | |
| sudo apt-get install -y mkdocs | |
| pip install mkdocs-material | |
| pip install Pygments | |
| cd docs/wiki | |
| mkdocs build | |
| cd .. | |
| cd .. | |
| git add docs | |
| git commit --message "Automatic CI Documentation." || true | |
| git push --quiet https://Shynixn:${{ secrets.GITHUB_TOKEN }}@github.com/Shynixn/BlockBall.git HEAD:master || true |