diff --git a/.github/builds/get_number.js b/.github/builds/get_number.js index 8361b93682..288c38bfb6 100644 --- a/.github/builds/get_number.js +++ b/.github/builds/get_number.js @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -const { getMcVersion } = require("./mc_version") +import { getMcVersion } from "./mc_version.js" const mcVersion = await getMcVersion(); diff --git a/.github/builds/index.js b/.github/builds/index.js index 44c275d910..c26d4fad39 100644 --- a/.github/builds/index.js +++ b/.github/builds/index.js @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -const { getMcVersion } = require("./mc_version") +import { getMcVersion } from "./mc_version.js" const buildNumber = process.argv[2]; const branch = process.argv[3]; diff --git a/.github/builds/mc_version.js b/.github/builds/mc_version.js index d971eed9b5..1b6ef2d2ad 100644 --- a/.github/builds/mc_version.js +++ b/.github/builds/mc_version.js @@ -3,8 +3,8 @@ * Copyright (c) Meteor Development. */ -const fs = require("fs") -const readline = require("readline") +import * as fs from "fs" +import * as readline from "readline" export async function getMcVersion() { let lines = readline.createInterface({ diff --git a/.github/builds/package.json b/.github/builds/package.json index 731e579ac3..56ec63a59a 100644 --- a/.github/builds/package.json +++ b/.github/builds/package.json @@ -5,8 +5,9 @@ "main": "index.js", "author": "MineGame159", "license": "MIT", + "type": "module", "scripts": { "get_number": "node get_number.js", - "start": "node index.js" + "webhook": "node index.js" } } diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5101a5cd56..72b8604fca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Dev Build +name: Build concurrency: group: "build" @@ -38,7 +38,7 @@ jobs: run: | cd .github/builds npm install - node get_number.js >> $GITHUB_OUTPUT + npm run get_number >> $GITHUB_OUTPUT - name: Build run: ./gradlew build -Pcommit=${{ github.sha }} -Pbuild_number=${{ steps.build-number.outputs.number }} @@ -47,7 +47,7 @@ jobs: if: ${{ failure() }} run: | cd .github/builds - npm start ${{ steps.build-number.outputs.number }} ${{ github.ref_name }} https://api.github.com/repos/MeteorDevelopment/meteor-client/compare/${{ github.event.before }}...${{ github.event.after }} false + npm run webhook ${{ steps.build-number.outputs.number }} ${{ 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 }} @@ -60,7 +60,7 @@ jobs: - name: Discord webhook run: | cd .github/builds - npm start ${{ steps.build-number.outputs.number }} ${{ github.ref_name }} https://api.github.com/repos/MeteorDevelopment/meteor-client/compare/${{ github.event.before }}...${{ github.event.after }} true + npm run webhook ${{ steps.build-number.outputs.number }} ${{ 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 }}