Build Beta Jars and Publish #135
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: Build Beta Jars and Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
build-publish-development: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: build-publish-beta | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: Get version | |
id: vars | |
run: | | |
version=$(cat version.txt) | |
run_number=${{ github.run_number }} | |
full_version="${version}-beta-${run_number}" | |
echo $full_version > version.txt | |
echo "version=$full_version" >> $GITHUB_OUTPUT | |
- name: Build Engine | |
uses: ./.github/actions/build-engine | |
# ---------------------------------------------------------------------------------------------------- | |
- name: Test Extensions | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: test clean --scan | |
build-root-directory: ./extensions | |
# ---------------------------------------------------------------------------------------------------- | |
- name: Publish Engine to Beta Maven Repository | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: publishAllPublicationsToTypewriterBetaRepository -PTypewriterBetaUsername=${{ secrets.MAVEN_USERNAME }} -PTypewriterBetaPassword=${{ secrets.MAVEN_PASSWORD }} --scan | |
build-root-directory: ./engine | |
- name: Publish All Extensions to Beta Maven Repository | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: publishAllPublicationsToTypewriterBetaRepository -PTypewriterBetaUsername=${{ secrets.MAVEN_USERNAME }} -PTypewriterBetaPassword=${{ secrets.MAVEN_PASSWORD }} --scan | |
build-root-directory: ./extensions | |
- name: Publish Module-Plugin to Beta Maven Repository | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: publishAllPublicationsToTypewriterBetaRepository -PTypewriterBetaUsername=${{ secrets.MAVEN_USERNAME }} -PTypewriterBetaPassword=${{ secrets.MAVEN_PASSWORD }} --scan | |
build-root-directory: ./module-plugin | |
# ---------------------------------------------------------------------------------------------------- | |
# Has to be after the publish, because it needs to delete the slim jars and only keep the shadowed jars for the modrinth upload | |
- name: Build Extensions | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: buildRelease --scan | |
build-root-directory: ./extensions | |
# ---------------------------------------------------------------------------------------------------- | |
- name: Publish Modrinth | |
uses: Kir-Antipov/[email protected] | |
id: publish | |
with: | |
modrinth-id: "Vm7B3ymm" | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: false | |
files: | | |
engine/engine-paper/build/libs/Typewriter.jar | |
extensions/**/build/libs/*.jar | |
name: "Typewriter v${{ steps.vars.outputs.version }} Build" | |
version: "${{ steps.vars.outputs.version }}" | |
version-type: "beta" | |
loaders: | | |
paper | |
game-versions: | | |
[1.21, 1.21.1] | |
dependencies: | | |
packetevents | |
- name: Publish Hangar | |
uses: gradle/gradle-build-action@v2 | |
continue-on-error: true | |
env: | |
HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }} | |
with: | |
arguments: engine-paper:publishPluginPublicationToHangar --scan | |
build-root-directory: ./engine | |
- name: Add Tag | |
uses: mathieudutour/[email protected] | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
default_bump: false | |
custom_tag: "${{ steps.vars.outputs.version }}" | |
release_branches: develop | |
- name: Notify Discord | |
uses: sarisia/actions-status-discord@v1 | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
nodetail: true | |
title: Published Beta Build | |
description: | | |
I have published a beta build of Typewriter. | |
Version: ${{ steps.vars.outputs.version }} | |
[Download](https://modrinth.com/plugin/typewriter/version/${{ steps.publish.outputs.modrinth-version }}) | |
- name: Notify Winston | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: 'https://winston-discord-bot.fly.dev/publishbeta' | |
method: 'GET' | |
customHeaders: '{"X-Signature": "${{ secrets.WINSTON_SIGNATURE }}"}' | |