Skip to content

Commit

Permalink
Update dev_build.yml
Browse files Browse the repository at this point in the history
Copied from meteor client
  • Loading branch information
IvanProCookie authored Jul 22, 2024
1 parent d09848a commit a25d774
Showing 1 changed file with 54 additions and 20 deletions.
74 changes: 54 additions & 20 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,61 @@
name: Publish Development Build
on: push
name: Dev Build

concurrency:
group: "build"
cancel-in-progress: false

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Wrapper Validation
uses: gradle/actions/wrapper-validation@v3
- name: Set up Java
uses: actions/setup-java@v4
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 21
distribution: adopt
- name: Build with Gradle
run: ./gradlew build
- name: Release
uses: marvinpinto/action-automatic-releases@latest
distribution: 'temurin'
java-version: '21'

- run: chmod +x gradlew

- name: Set up Node JS
uses: actions/setup-node@v3
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: latest
prerelease: true
title: Dev Build
files: |
./build/libs/*.jar
node-version: latest

- name: Get current dev build number
id: dev-build
run: |
cd .github/devbuilds
npm install
node get_number.js >> $GITHUB_OUTPUT
- name: Build
run: ./gradlew build -Pcommit=${{ github.sha }} -Pdevbuild=${{ steps.dev-build.outputs.number }}

- name: Webhook Failure
if: ${{ failure() }}
run: |
cd .github/devbuilds
npm start ${{ github.ref_name }} https://api.github.com/repos/MeteorDevelopment/meteor-client/compare/${{ github.event.before }}...${{ github.event.after }} false
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}


- name: Publish
run: ./gradlew publish -Pcommit=${{ github.sha }} -Pdevbuild=${{ steps.dev-build.outputs.number }}
env:
MAVEN_METEOR_ALIAS: ${{ secrets.MAVEN_METEOR_ALIAS }}
MAVEN_METEOR_TOKEN: ${{ secrets.MAVEN_METEOR_TOKEN }}

- name: Upload file & Discord webhook
run: |
cd .github/devbuilds
npm start ${{ github.ref_name }} https://api.github.com/repos/MeteorDevelopment/meteor-client/compare/${{ github.event.before }}...${{ github.event.after }} true
env:
SERVER_TOKEN: ${{ secrets.SERVER_TOKEN }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

0 comments on commit a25d774

Please sign in to comment.