Build Beta Jars and Publish #119
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: Build Extensions | |
uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: test buildRelease --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 | |
# ---------------------------------------------------------------------------------------------------- | |
- name: Publish Modrinth | |
uses: Kir-Antipov/[email protected] | |
id: publish | |
with: | |
modrinth-id: "Vm7B3ymm" | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-featured: false | |
files: | | |
plugin/build/libs/typewriter.jar | |
extensions/**/build/libs/*.jar | |
name: "Typewriter v${{ steps.vars.outputs.version }} Development Build" | |
version: "${{ steps.vars.outputs.version }}" | |
version-type: "beta" | |
loaders: | | |
paper | |
game-versions: | | |
[1.21] | |
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: publishPluginPublicationToHangar --scan | |
build-root-directory: ./plugin | |
- name: Add Tag | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ env.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 Development Build | |
description: | | |
I have published a development 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 }}"}' | |