Improve Build CI/CD System (#552)

This improves the Build CI/CD System and the Release Commit Workflows.

The CD system now builds and zips the pack in parallel, increasing the speed twofold.
The CI system now does not produce double zips, but remains the same speed, thanks to parallel processing.

The CI system now also changes server.properties and random patches config files for the build, and the buildscript has been edited for that.

Since the CI system replaces the nightly task, the nightly workflow has been deleted. The makeArtifactNames task is now used, and has been changed to remove usage of deprecated features.

The release commit workflows now supports updating files without version input, and the version is grabbed from versions.txt.' The code for the release commit workflows has also been greatly cleaned up.

The changes made to the random patches template files have also been updated. The changes made incorrectly to the issue templates in #487 have also been fixed.

The README badges have also been changed. The issue badge has been replaced by a nightly builds badge.

Finally, this changes the forge download process to try again if the response is null, resulting in a decrease, to almost none, test build pack and build pack failures.

[INTERNAL]
[IGNORE]
checks = { compareNot = "1.7-alpha-1" }
[IGNORE]
This commit is contained in:
Integer Limit 2023-12-04 21:56:24 +11:00 committed by GitHub
parent 00a04e5426
commit 8a4b323505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 620 additions and 343 deletions

View File

@ -11,7 +11,7 @@ body:
id: version
attributes:
label: Nomi CEu Version
description: The version of Nomi CEu you were using when this bug was encountered. If you do not know what it is, check the title of your instance window. If you do not see your version here, please update to the newest alpha, beta or release of the pack.
description: The version of Nomi CEu you were using when this bug was encountered. If you do not know what it is, check the title of your instance window. If you do not see your version here, please update to the newest alpha, beta or release of the pack.
options:
- 1.7-alpha-1
- 1.6.1a

View File

@ -11,7 +11,7 @@ body:
id: version
attributes:
label: Nomi CEu Version
description: The version of Nomi CEu you were using when this bug was encountered. If you do not know what it is, check the title of your instance window. If you do not see your version here, please update to the newest alpha, beta or release of the pack.
description: The version of Nomi CEu you are using as the basis for this feature request. If you do not know what it is, check the title of your instance window. f you do not see your version here, please update to the newest alpha, beta or release of the pack.
options:
- 1.7-alpha-1
- 1.6.1a

View File

@ -78,9 +78,10 @@ on:
required: false
jobs:
build:
buildSingle:
name: Build Pack (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ !inputs.separate_upload }}
env:
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
@ -124,9 +125,9 @@ jobs:
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Build Pack
- name: Build and Zip Pack
working-directory: ./tools
run: npx gulp buildAll
run: npx gulp
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
CHANGELOG_BRANCH: ${{ inputs.changelog_branch }}
@ -134,13 +135,8 @@ jobs:
CHANGELOG_CF_URL: ${{ inputs.changelog_cf_url }}
COMPARE_TAG: ${{ inputs.compare_tag }}
- name: Zip Pack
working-directory: ./tools
run: npx gulp zipAll
- name: Upload All Files
uses: actions/upload-artifact@v3
if: ${{ !inputs.separate_upload }}
with:
name: Built Pack
path: |
@ -148,36 +144,320 @@ jobs:
./build/*.md
if-no-files-found: error
makeNames:
name: Make Artifact Names (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.separate_upload }}
env:
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_HEAD_REF: ${{ inputs.head_ref }}
TRUE_SHA: ${{ inputs.true_sha }}
outputs:
client: ${{ steps.artifactNames.outputs.client }}
server: ${{ steps.artifactNames.outputs.server }}
lang: ${{ steps.artifactNames.outputs.lang }}
mmc: ${{ steps.artifactNames.outputs.mmc }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Make Artifact Names
id: artifactNames
working-directory: ./tools
run: npx gulp makeArtifactNames
buildClient:
name: Build Pack Client (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.separate_upload }}
needs: makeNames
env:
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_HEAD_REF: ${{ inputs.head_ref }}
TRUE_SHA: ${{ inputs.true_sha }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Build Client
working-directory: ./tools
run: npx gulp buildClient
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
CHANGELOG_BRANCH: ${{ inputs.changelog_branch }}
CHANGELOG_URL: ${{ inputs.changelog_url }}
CHANGELOG_CF_URL: ${{ inputs.changelog_cf_url }}
COMPARE_TAG: ${{ inputs.compare_tag }}
- name: Upload Client Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: Client Zip
path: ./build/*-client.zip
name: ${{ needs.makeNames.outputs.client }}
path: ./build/client/**/*
if-no-files-found: error
buildServer:
name: Build Pack Server (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.separate_upload }}
needs: makeNames
env:
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_HEAD_REF: ${{ inputs.head_ref }}
TRUE_SHA: ${{ inputs.true_sha }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Build Server
working-directory: ./tools
run: npx gulp buildServer
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
CHANGELOG_BRANCH: ${{ inputs.changelog_branch }}
CHANGELOG_URL: ${{ inputs.changelog_url }}
CHANGELOG_CF_URL: ${{ inputs.changelog_cf_url }}
COMPARE_TAG: ${{ inputs.compare_tag }}
- name: Upload Server Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: Server Zip
path: ./build/*-server.zip
name: ${{ needs.makeNames.outputs.server }}
path: ./build/server/**/*
if-no-files-found: error
buildMMC:
name: Build Pack MMC (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.separate_upload }}
needs: makeNames
env:
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_HEAD_REF: ${{ inputs.head_ref }}
TRUE_SHA: ${{ inputs.true_sha }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Build MMC
working-directory: ./tools
run: npx gulp buildMMC
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
CHANGELOG_BRANCH: ${{ inputs.changelog_branch }}
CHANGELOG_URL: ${{ inputs.changelog_url }}
CHANGELOG_CF_URL: ${{ inputs.changelog_cf_url }}
COMPARE_TAG: ${{ inputs.compare_tag }}
- name: Upload MMC Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: ${{ needs.makeNames.outputs.mmc }}
path: ./build/mmc/**/*
if-no-files-found: error
buildLang:
name: Build Pack Lang and Changelogs (${{ inputs.tag }})
runs-on: ubuntu-latest
if: ${{ inputs.separate_upload }}
needs: makeNames
env:
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
GITHUB_HEAD_REF: ${{ inputs.head_ref }}
TRUE_SHA: ${{ inputs.true_sha }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Build Lang and Changelogs
working-directory: ./tools
run: npx gulp buildLang
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
CHANGELOG_BRANCH: ${{ inputs.changelog_branch }}
CHANGELOG_URL: ${{ inputs.changelog_url }}
CHANGELOG_CF_URL: ${{ inputs.changelog_cf_url }}
COMPARE_TAG: ${{ inputs.compare_tag }}
- name: Upload Lang Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: Lang Zip
path: ./build/*-lang.zip
if-no-files-found: error
- name: Upload MMC Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: MMC Zip
path: ./build/*-mmc.zip
name: ${{ needs.makeNames.outputs.lang }}
path: ./build/lang/**/*
if-no-files-found: error
- name: Upload Changelogs

View File

@ -1,104 +0,0 @@
name: Nightly Builds
on:
push:
branches:
- dev
tags-ignore:
- '**'
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow --tags --force
- name: Restore cached files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: "Setup NodeJS v16"
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: "Download NPM packages"
working-directory: ./tools
run: npm ci
- name: "Check environmental variables"
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: "Build everything"
working-directory: ./tools
run: npx gulp buildAll
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: "Prune cache"
working-directory: ./tools
run: npx gulp pruneCache
##
## Upload artifacts.
##
- name: "Make artifact names"
id: artifactNames
working-directory: ./tools
run: npx gulp makeArtifactNames
- name: "Upload client artifact"
uses: actions/upload-artifact@v2
with:
name: ${{ steps.artifactNames.outputs.client }}
path: |
build/client/**/*
- name: "Upload server artifact"
uses: actions/upload-artifact@v2
with:
name: ${{ steps.artifactNames.outputs.server }}
path: |
build/server/**/*
- name: "Upload lang artifact"
uses: actions/upload-artifact@v2
with:
name: ${{ steps.artifactNames.outputs.lang }}
path: |
build/lang/**/*
- name: "Upload changelog artifact"
uses: actions/upload-artifact@v2
with:
name: changelog
path: |
build/shared/CHANGELOG.md
- name: "Fire Discord webhook"
working-directory: ./tools
run: npx gulp fireNightlyWebhook
env:
GITHUB_RUN_ID: ${{ github.run_id }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

View File

@ -27,7 +27,7 @@ jobs:
name: Create Release Commit (${{ inputs.tag }})
uses: ./.github/workflows/releasecommit.yml
with:
version: ${{ inputs.tag }}
tag: ${{ inputs.tag }}
release_type: ${{ inputs.release_type }}
secrets: inherit
permissions:

View File

@ -3,56 +3,57 @@ name: Create Release Commit
on:
workflow_dispatch:
inputs:
version:
tag:
description: |
Release Version (aka 1.6.1a, 1.6.1-beta-3, 2.0, etc.).
Tag to release (aka 1.6.1a, 1.6.1-beta-3, 2.0, etc.).
Still important if not a release, and will be used to replace all version fields.
required: true
If this is just a release, then the version will be grabbed from the top line of version.txt. However, this field is needed if version.txt does not exist or is empty.
type: string
required: false
release_type:
description: 'Release Type. Will be ignored if not a release.'
type: choice
required: true
required: false
default: 'Release'
options:
- 'Release'
- 'Beta Release'
- 'Alpha Release'
is_release:
update_files:
description: |
Whether this commit is a release. Usually, leave this set to true. See CONTRIBUTING.md for more details.
Whether this commit is just to update files. version.txt will not be changed. This is used when the templates are changed, and the main files need to be updated.
type: boolean
required: true
default: true
default: false
workflow_call:
inputs:
version:
tag:
description: |
Release Version (aka 1.6.1a, 1.6.1-beta-3, 2.0, etc.).
Tag to release (aka 1.6.1a, 1.6.1-beta-3, 2.0, etc.).
Still important if not a release, and will be used to replace all version fields.
If this is just a release, then the version will be grabbed from the top line of version.txt. However, this field is needed if version.txt does not exist or is empty.
type: string
required: true
required: false
release_type:
description: 'Release Type. Will be ignored if not a release.'
type: string
required: true
is_release:
required: false
update_files:
description: |
Whether this commit is a release. See CONTRIBUTING.md for more details.
Whether this commit is just to update files. version.txt will not be changed. This is used when the templates are changed, and the main files need to be updated.
type: boolean
required: false
default: true
default: false
jobs:
# Release Commit Steps
createReleaseCommit:
name: Create Release Commit (${{ inputs.version }})
runs-on: ubuntu-latest
if: "${{ inputs.is_release }}"
env:
VERSION: "${{ inputs.version }}"
RELEASE_TYPE: "${{ inputs.release_type }}"
UPDATE_FILES: ${{ inputs.update_files }}
GITHUB_TAG: ${{ inputs.tag }}
RELEASE_TYPE: ${{ inputs.release_type }}
steps:
- name: Checkout Repo
@ -91,84 +92,29 @@ jobs:
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Set Release Version
- name: Update Files
working-directory: ./tools
run: |
npx gulp addVersionAll
run: npx gulp updateFilesAll
- name: Commit and Push Release Changes
uses: "stefanzweifel/git-auto-commit-action@v4"
id: "commit-release"
uses: stefanzweifel/git-auto-commit-action@v5
id: commit-release
if: ${{ !inputs.update_files }}
with:
commit_message: "${{ inputs.release_type }} ${{ inputs.version }}\n\n[NO CATEGORY]"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
tagging_message: "${{ inputs.version }}"
commit_message: "${{ inputs.release_type }} ${{ inputs.tag }}\n\n[NO CATEGORY]"
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
tagging_message: "${{ inputs.tag }}"
- name: Throw Error if No Release Changes were Detected
if: ${{ steps.commit-release.outputs.changes_detected == 'false' }}
run: |
echo "No Changes were Made."
exit 1
# Non-Release Commit Steps
updateFilesFromTemplate:
name: Update Files from Templates
runs-on: ubuntu-latest
if: "${{ !inputs.is_release }}"
env:
VERSION: "${{ inputs.version }}"
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.SSH_KEY }}
- name: Restore Cached Files
uses: actions/cache@v3
id: cache
with:
path: |
~/.npm
./.cache
./tools/node_modules
key: ${{ runner.os }}-bunny-${{ hashFiles('**/.cache', '**/package-lock.json', '**/manifest.json') }}
restore-keys: ${{ runner.os }}-bunny-
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
node-version: "16"
check-latest: true
- name: Setup NPM Packages
working-directory: ./tools
run: npm ci
- name: Check Environmental Variables
working-directory: ./tools
run: npx gulp check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Update Files from Templates
working-directory: ./tools
run: |
npx gulp updateTemplatesAll
- name: Commit and Push Template Changes
uses: "stefanzweifel/git-auto-commit-action@v4"
id: "commit-template"
- name: Commit and Push Update Changes
uses: stefanzweifel/git-auto-commit-action@v5
id: commit-update
if: ${{ inputs.update_files }}
with:
commit_message: "Update Issue, Server and RP Config Files from Templates\n\n[SKIP]"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"
- name: Throw Error if No Template Changes were Detected
if: ${{ steps.commit-template.outputs.changes_detected == 'false' }}
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- name: Throw Error if No Changes were Detected
if: ${{ steps.commit-release.outputs.changes_detected == 'false' || steps.commit-update.outputs.changes_detected == 'false' }}
run: |
echo "No Template Changes were detected. This may be an error."
echo "No Changes were Detected. Most likely, this is an error."
exit 1

View File

@ -36,7 +36,7 @@ jobs:
name: Create Release Commit (${{ inputs.tag }})
uses: ./.github/workflows/releasecommit.yml
with:
version: ${{ inputs.tag }}
tag: ${{ inputs.tag }}
release_type: ${{ inputs.release_type }}
secrets: inherit
permissions:

View File

@ -3,7 +3,7 @@ name: "[NOT CALLABLE] Test Build Pack"
on:
push:
branches:
- main
- main-int
- test_buildscript*
pull_request:
@ -16,7 +16,7 @@ concurrency:
jobs:
build:
# Only allow runs from commits to Nomi-CEu Branches or from pull requests from Nomi-CEu repo
if: "${{ github.repository_owner == 'Nomi-CEu' && ( !github.event.pull_request || github.event.pull_request.head.repo.owner.login == 'Nomi-CEu' ) }}"
#if: "${{ github.repository_owner == 'Nomi-CEu' && ( !github.event.pull_request || github.event.pull_request.head.repo.owner.login == 'Nomi-CEu' ) }}"
name: Test Build Pack
uses: ./.github/workflows/buildpack.yml
with:

View File

@ -2,9 +2,9 @@
<h1 align="center">Nomifactory CEu</h1>
<p align="center"><b><i>Fork of <a href="https://github.com/Nomifactory/Nomifactory"> Nomifactory</a>, using <a href="https://github.com/GregTechCEu/GregTech"> GregTech CEu</a> and its related mods.</i></b></p>
<h1 align="center">
<a href="https://github.com/Nomi-CEu/Nomi-CEu/issues"><img src="https://img.shields.io/github/issues/Nomi-CEu/Nomi-CEu?style=for-the-badge&color=orange" alt="Issues"></a>
<a href="https://github.com/Nomi-CEu/Nomi-CEu/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Nomi-CEu/Nomi-CEu?style=for-the-badge" alt="License"></a>
<a href="https://discord.com/invite/zwQzqP8b6q"><img src="https://img.shields.io/discord/927050775073534012?color=5464ec&label=Discord&style=for-the-badge" alt="Discord"></a>
<a href="https://github.com/Nomi-CEu/Nomi-CEu/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Nomi-CEu/Nomi-CEu?style=for-the-badge&logo=github" alt="License"></a>
<a href="https://nightly.link/Nomi-CEu/Nomi-CEu/workflows/testbuildpack/main"><img src="https://img.shields.io/github/actions/workflow/status/Nomi-CEu/Nomi-CEu/testbuildpack.yml?style=for-the-badge&logo=github&label=builds&color=orange" alt="Builds"></a>
<a href="https://discord.com/invite/zwQzqP8b6q"><img src="https://img.shields.io/discord/927050775073534012?style=for-the-badge&logo=discord&logoColor=%23ffffff&label=discord%20&labelColor=gray&color=%235865F2" alt="Discord"></a>
<br>
<a href="https://www.curseforge.com/minecraft/modpacks/Nomi-CEu"><img src="https://cf.way2muchnoise.eu/594351.svg?badge_style=for_the_badge" alt="CurseForge"></a>
<a href="https://www.curseforge.com/minecraft/modpacks/Nomi-CEu"><img src="https://cf.way2muchnoise.eu/versions/For%20MC_594351_all.svg?badge_style=for_the_badge" alt="MC Versions"></a>

View File

@ -146,7 +146,7 @@ misc {
# Fixes MC-2025.
# More information can be found here: https://www.reddit.com/r/Mojira/comments/8pgd4q/final_and_proper_fix_to_mc2025_simple_reliable/
# Default: true
B:mc2025Fix=true
B:mc2025Fix=false
# Fixes MC-64836, which causes non-player entities to be allowed to control minecarts using their AI.
# Default: true
@ -154,7 +154,7 @@ misc {
# Fixes MC-5694, which causes fast mining to sometimes only destroy blocks client-side only.
# Default: true
B:miningGhostBlocksFix=true
B:miningGhostBlocksFix=false
# Fixes MC-10369 (server-side particle spawning not creating particles for clients) and MC-93826 (breeding hearts only showing once instead of all of the time an animal can breed).
# Default: true

View File

@ -146,7 +146,7 @@ misc {
# Fixes MC-2025.
# More information can be found here: https://www.reddit.com/r/Mojira/comments/8pgd4q/final_and_proper_fix_to_mc2025_simple_reliable/
# Default: true
B:mc2025Fix=true
B:mc2025Fix=false
# Fixes MC-64836, which causes non-player entities to be allowed to control minecarts using their AI.
# Default: true
@ -154,7 +154,7 @@ misc {
# Fixes MC-5694, which causes fast mining to sometimes only destroy blocks client-side only.
# Default: true
B:miningGhostBlocksFix=true
B:miningGhostBlocksFix=false
# Fixes MC-10369 (server-side particle spawning not creating particles for clients) and MC-93826 (breeding hearts only showing once instead of all of the time an animal can breed).
# Default: true

View File

@ -146,7 +146,7 @@ misc {
# Fixes MC-2025.
# More information can be found here: https://www.reddit.com/r/Mojira/comments/8pgd4q/final_and_proper_fix_to_mc2025_simple_reliable/
# Default: true
B:mc2025Fix=true
B:mc2025Fix=false
# Fixes MC-64836, which causes non-player entities to be allowed to control minecarts using their AI.
# Default: true
@ -154,7 +154,7 @@ misc {
# Fixes MC-5694, which causes fast mining to sometimes only destroy blocks client-side only.
# Default: true
B:miningGhostBlocksFix=true
B:miningGhostBlocksFix=false
# Fixes MC-10369 (server-side particle spawning not creating particles for clients) and MC-93826 (breeding hearts only showing once instead of all of the time an animal can breed).
# Default: true

View File

@ -1,4 +1,4 @@
// noinspection JSUnusedGlobalSymbols
// noinspection JSUnusedGlobalSymbols,UnnecessaryLocalVariableJS
import * as gulp from "gulp";
@ -8,23 +8,13 @@ export const pruneCache = pruneCacheTask;
import * as quest from "./tasks/github/quest";
export const transformQB = quest.transformQuestBook;
import * as releaseCommit from "./tasks/misc/releaseCommit";
export const checkRelease = releaseCommit.check;
// Normal Tasks
export const addVersionIssue = gulp.series(checkRelease, releaseCommit.updateIssueTemplates);
export const addVersionRandomPatches = gulp.series(checkRelease, releaseCommit.updateRandomPatchesConfig);
export const addVersionServer = gulp.series(checkRelease, releaseCommit.updateServerProperties);
export const addVersionMainMenu = gulp.series(checkRelease, releaseCommit.updateMainMenuConfig);
export const addVersionAll = gulp.series(checkRelease, releaseCommit.updateAll);
// Non Release Tasks
const setNotRelease = releaseCommit.setNotRelease;
export const updateTemplatesIssue = gulp.series(setNotRelease, addVersionIssue);
export const updateTemplatesRandomPatches = gulp.series(setNotRelease, addVersionRandomPatches);
export const updateTemplatesServer = gulp.series(setNotRelease, addVersionServer);
export const updateTemplatesMainMenu = gulp.series(setNotRelease, addVersionMainMenu);
export const updateTemplatesAll = gulp.series(setNotRelease, addVersionAll);
import * as transformFiles from "./tasks/misc/transformFiles";
export const updateFilesIssue = transformFiles.updateFilesIssue;
export const updateFilesRandomPatches = transformFiles.updateFilesRandomPatches;
export const updateFilesServer = transformFiles.updateFilesServer;
export const updateFilesMainMenu = transformFiles.updateFilesMainMenu;
export const updateFilesBuild = transformFiles.updateFilesBuild;
export const updateFilesAll = transformFiles.updateAll;
import * as changelog from "./tasks/changelog/createChangelog";
export const createChangelog = changelog.createRootChangelog;
@ -37,10 +27,13 @@ import mmcTasks from "./tasks/mmc";
import modTasks from "./tasks/misc/downloadMods";
export const buildClient = gulp.series(sharedTasks, clientTasks);
export const buildServer = gulp.series(sharedTasks, modTasks, serverTasks);
export const buildServer = gulp.series(gulp.parallel(sharedTasks, modTasks), serverTasks);
export const buildLang = gulp.series(sharedTasks, langTasks);
export const buildMMC = gulp.series(sharedTasks, modTasks, clientTasks, mmcTasks);
export const buildAll = gulp.series(sharedTasks, modTasks, gulp.series(clientTasks, langTasks, serverTasks, mmcTasks));
export const buildMMC = gulp.series(gulp.parallel(sharedTasks, modTasks), clientTasks, mmcTasks);
export const buildAll = gulp.series(
gulp.parallel(sharedTasks, modTasks),
gulp.series(gulp.parallel(clientTasks, langTasks, serverTasks), mmcTasks),
);
import checkTasks from "./tasks/checks";
export const check = gulp.series(checkTasks);
@ -52,6 +45,8 @@ export const zipLang = zip.zipLang;
export const zipMMC = zip.zipMMC;
export const zipAll = zip.zipAll;
exports.default = gulp.series(buildAll, zipAll);
import * as gha from "./tasks/misc/gha";
export const makeArtifactNames = gha.makeArtifactNames;

View File

@ -9,6 +9,7 @@
"version": "1.2.2",
"license": "LGPL-3.0",
"dependencies": {
"@actions/core": "^1.10.1",
"@egjs/list-differ": "^1.0.1",
"@iarna/toml": "^2.2.5",
"@types/iarna__toml": "^2.0.5",
@ -61,6 +62,32 @@
"upath": "^2.0.1"
}
},
"node_modules/@actions/core": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
"dependencies": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/core/node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@actions/http-client": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz",
"integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==",
"dependencies": {
"tunnel": "^0.0.6",
"undici": "^5.25.4"
}
},
"node_modules/@babel/code-frame": {
"version": "7.12.11",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
@ -210,6 +237,14 @@
"node": ">= 4"
}
},
"node_modules/@fastify/busboy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz",
"integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==",
"engines": {
"node": ">=14"
}
},
"node_modules/@humanwhocodes/config-array": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz",
@ -11029,6 +11064,14 @@
"typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
}
},
"node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@ -11168,6 +11211,17 @@
"integrity": "sha512-Ia0sQNrMPXXkqVFt6w6M1n1oKo3NfKs+mvaV811Jwir7vAk9a6PVV9VPYf6X3BU97QiLEmuW3uXH9u87zDFfdw==",
"dev": true
},
"node_modules/undici": {
"version": "5.28.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz",
"integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==",
"dependencies": {
"@fastify/busboy": "^2.0.0"
},
"engines": {
"node": ">=14.0"
}
},
"node_modules/union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
@ -11814,6 +11868,31 @@
}
},
"dependencies": {
"@actions/core": {
"version": "1.10.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
"requires": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
},
"dependencies": {
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}
}
},
"@actions/http-client": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.0.tgz",
"integrity": "sha512-q+epW0trjVUUHboliPb4UF9g2msf+w61b32tAkFEwL/IwP0DQWgbCMM0Hbe3e3WXSKz5VcUXbzJQgy8Hkra/Lg==",
"requires": {
"tunnel": "^0.0.6",
"undici": "^5.25.4"
}
},
"@babel/code-frame": {
"version": "7.12.11",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz",
@ -11937,6 +12016,11 @@
}
}
},
"@fastify/busboy": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.0.tgz",
"integrity": "sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA=="
},
"@humanwhocodes/config-array": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz",
@ -20487,6 +20571,11 @@
"tslib": "^1.8.1"
}
},
"tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@ -20597,6 +20686,14 @@
"integrity": "sha512-UR1khWeAjugW3548EfQmL9Z7pGMlBgXteQpr1IZeZBtnkCJQJIJ1Scj0mb9wQaPvUZ9Q17XqW6TIaPchJkyfqw==",
"dev": true
},
"undici": {
"version": "5.28.2",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz",
"integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==",
"requires": {
"@fastify/busboy": "^2.0.0"
}
},
"union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",

View File

@ -50,6 +50,7 @@
"upath": "^2.0.1"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@egjs/list-differ": "^1.0.1",
"@iarna/toml": "^2.2.5",
"@types/iarna__toml": "^2.0.5",

View File

@ -42,7 +42,7 @@ export default class ChangelogData {
// See if current run is test
if (isEnvVariableSet("TEST_CHANGELOG")) {
try {
this.isTest = JSON.parse(process.env.TEST_CHANGELOG);
this.isTest = JSON.parse(process.env.TEST_CHANGELOG.toLowerCase());
} catch (err) {
throw new Error("Test Changelog Env Variable set to Invalid Value.");
}

View File

@ -7,7 +7,7 @@ import { langDestDirectory, overridesFolder, sharedDestDirectory } from "../../g
import fs from "fs";
/**
* Checks and creates all necessary directories so we can build the client safely.
* Checks and creates all necessary directories so we can build the lang safely.
*/
async function createLangDirs() {
if (!fs.existsSync(langDestDirectory)) {

View File

@ -1,6 +1,7 @@
import { modpackManifest } from "../../globals";
import { makeArtifactNameBody } from "../../util/util";
import sanitize from "sanitize-filename";
import { setOutput } from "@actions/core";
export async function makeArtifactNames(): Promise<void> {
const body = makeArtifactNameBody(modpackManifest.name);
@ -8,9 +9,10 @@ export async function makeArtifactNames(): Promise<void> {
client: body + "-client",
server: body + "-server",
lang: body + "-lang",
mmc: body + "-mmc",
};
Object.keys(names).forEach((name) => {
console.log(`::set-output name=${name}::${sanitize(names[name].toLowerCase())}`);
setOutput(name, sanitize(names[name].toLowerCase()));
});
}

View File

@ -4,90 +4,85 @@ import { configFolder, configOverridesFolder, rootDirectory, templatesFolder } f
import mustache from "mustache";
import gulp from "gulp";
import dedent from "dedent-js";
import { checkEnvironmentalVariables } from "../../util/util";
import { isEnvVariableSet } from "../../util/util";
import sortedStringify from "json-stable-stringify-without-jsonify";
import log, { error } from "fancy-log";
import { error } from "fancy-log";
import { BuildData } from "../../types/transformFiles";
// This updates all the files, for a release.
// IF DEBUGGING:
// Change debug value to true
// Change version to a string
const debug = false;
const version: string = process.env.VERSION;
// If it is not a release or build, and thus no changes to versions need to be made.
// This occurs when the files are to be updated from the templates outside of a release or a build.
let updateFiles: boolean;
let updateFileVersion: string;
let updateFileTransformedVersion: string;
// If it is not a release, and thus no changes to versions need to be made.
// This occurs when the files are to be updated from the templates outside of a release.
// Optional variable to set.
let notRelease = false;
let buildData: BuildData;
/**
* Checks if env variable are set, creates versions.txt if file does not exist, and checks if new version already exists in versions.txt.
*/
export async function check(): Promise<void> {
if (!debug) {
checkEnvironmentalVariables(["VERSION"]);
}
const versionsFilePath: string = upath.join(templatesFolder, "versions.txt");
if (notRelease) {
log("Detected that this is not a release commit.");
log("Version info will not change, but the files will be updated from the template.");
await checkNotRelease(versionsFilePath);
} else {
log("Detected that this is a release commit.");
await checkRelease(versionsFilePath);
}
}
/**
* Sets this workflow as a non-release.
*/
export async function setNotRelease(): Promise<void> {
notRelease = true;
}
// Checks for non-release commits
async function checkNotRelease(versionsFilePath: string) {
// Check if versions.txt exists
if (!fs.existsSync(versionsFilePath)) {
error(`Version.txt does not exist. Creating empty file, and adding ${version} to it. This may be an error.`);
// Create Versions.txt, with version
await fs.promises.writeFile(versionsFilePath, ` - ${version}`);
} else {
// Check for duplicate entries
let versionList = await fs.promises.readFile(versionsFilePath, "utf8");
// No Duplicate Key
if (!versionList.includes(version)) {
error(`Version is not in version.txt. Adding ${version} to version.txt. This may be an error.`);
versionList = ` - ${version}\n${versionList}`;
await fs.promises.writeFile(versionsFilePath, versionList);
async function updateFilesSetup(): Promise<void> {
updateFiles = false;
// See if current run is to update files
if (isEnvVariableSet("UPDATE_FILES")) {
try {
updateFiles = JSON.parse(process.env.UPDATE_FILES.toLowerCase());
} catch (err) {
throw new Error("Update Files Env Variable set to Invalid Value.");
}
}
}
buildData = new BuildData();
// Checks for release Commits
async function checkRelease(versionsFilePath: string) {
// Check if versions.txt exists
const versionsFilePath: string = upath.join(templatesFolder, "versions.txt");
updateFileVersion = "";
if (!buildData.isVersionBuild() && !updateFiles) return;
// Versions.txt handling
if (!fs.existsSync(versionsFilePath)) {
if (updateFiles) {
if (!buildData.isVersionBuild())
throw new Error(
"In order to update files, needs versions.txt to exist and have values, or the version to be set via the GITHUB_TAG environmental variable.",
);
updateFileVersion = buildData.rawVersion;
updateFileTransformedVersion = buildData.transformedVersion;
return;
}
error("Version.txt does not exist. Creating empty file. This may be an error.");
// Create Versions.txt
fs.closeSync(fs.openSync(versionsFilePath, "w"));
} else {
// Check for duplicate entries
const versionList = await fs.promises.readFile(versionsFilePath, "utf8");
if (updateFiles) {
if (!versionList) {
if (!buildData.isVersionBuild())
throw new Error(
"In order to update files, needs versions.txt to exist and have values, or the version to be set via the GITHUB_TAG environmental variable.",
);
updateFileVersion = buildData.rawVersion;
updateFileTransformedVersion = buildData.transformedVersion;
return;
}
updateFileVersion = versionList.split("\n")[0].replace("-", "").trim();
updateFileTransformedVersion = `v${updateFileVersion}`;
return;
}
// Duplicate Key
if (versionList.includes(`${version}\n`)) {
if (versionList.includes(`${buildData.rawVersion}\n`)) {
throw new Error("Version already exists in version.txt. Exiting...");
}
}
}
async function updateFilesBuildSetup(): Promise<void> {
updateFiles = true;
buildData = new BuildData();
updateFileVersion = buildData.rawVersion;
updateFileTransformedVersion = buildData.transformedVersion;
}
/**
* @param readPath The filepath to read from. (Template)
* @param writePaths The filepaths to write to.
@ -114,7 +109,7 @@ async function modifyFile(readPath: string, writePaths: string[], replacementObj
}
}
export async function updateIssueTemplates(): Promise<void> {
async function updateIssueTemplates(): Promise<void> {
// Filenames
const fileNames: string[] = ["001-bug-report.yml", "002-feature-request.yml"];
@ -122,9 +117,13 @@ export async function updateIssueTemplates(): Promise<void> {
let versionList: string = await fs.promises.readFile(versionsFilePath, "utf8");
if (!notRelease) {
if (!updateFiles) {
if (!buildData.isVersionBuild())
throw new Error(
"In order to update Issue Templates, the version must be set via the GITHUB_TAG environmental variable.",
);
// Add new version to list, with indent
versionList = ` - ${version}\n${versionList}`;
versionList = ` - ${buildData.rawVersion}\n${versionList}`;
}
// Replacement Object
@ -145,7 +144,7 @@ export async function updateIssueTemplates(): Promise<void> {
}
}
export async function updateRandomPatchesConfig(): Promise<void> {
async function updateRandomPatchesConfig(): Promise<void> {
// Filename & paths
const fileName = "randompatches.cfg";
const readPath: string = upath.join(templatesFolder, fileName);
@ -156,7 +155,7 @@ export async function updateRandomPatchesConfig(): Promise<void> {
// Replacement object
const replacementObject: Record<string, unknown> = {
version: version,
versionTitle: updateFiles ? updateFileTransformedVersion : buildData.transformedVersion,
mode: "Normal",
};
@ -171,7 +170,7 @@ export async function updateRandomPatchesConfig(): Promise<void> {
await modifyFile(readPath, [writePathExpert], replacementObject);
}
export async function updateServerProperties(): Promise<void> {
async function updateServerProperties(): Promise<void> {
// File name of the output files
const fileName = "server.properties";
@ -183,7 +182,7 @@ export async function updateServerProperties(): Promise<void> {
// Replacement Object
const replacementObject: Record<string, unknown> = {
version: version,
versionTitle: updateFiles ? updateFileTransformedVersion : buildData.transformedVersion,
};
// Read and Write paths for normal
@ -204,15 +203,20 @@ export async function updateServerProperties(): Promise<void> {
await modifyFile(readPathExpert, [writePathExpert], replacementObject);
}
export async function updateMainMenuConfig(): Promise<void> {
async function updateMainMenuConfig(): Promise<void> {
// Filename & paths
const fileName = "mainmenu.json";
const readPath: string = upath.join(templatesFolder, fileName);
const writePath: string = upath.join(rootDirectory, configFolder, "CustomMainMenu", fileName);
if (!updateFiles && !buildData.isVersionBuild())
throw new Error(
"The main menu should only be updated if the version is set via the GITHUB_TAG environmental variable.",
);
// Replacement object
const replacementObject: Record<string, unknown> = {
version: version,
version: updateFiles ? updateFileVersion : buildData.rawVersion,
};
// Read file
@ -229,7 +233,14 @@ export async function updateMainMenuConfig(): Promise<void> {
return await fs.promises.writeFile(writePath, sortedStringify(modifiedData, { space: 2 }), "utf8");
}
export const updateFilesIssue = gulp.series(updateFilesSetup, updateIssueTemplates);
export const updateFilesRandomPatches = gulp.series(updateFilesSetup, updateRandomPatchesConfig);
export const updateFilesServer = gulp.series(updateFilesSetup, updateServerProperties);
export const updateFilesMainMenu = gulp.series(updateFilesSetup, updateMainMenuConfig);
export const updateFilesBuild = gulp.series(updateFilesBuildSetup, updateRandomPatchesConfig, updateServerProperties);
export const updateAll = gulp.series(
updateFilesSetup,
updateIssueTemplates,
updateRandomPatchesConfig,
updateServerProperties,

View File

@ -43,4 +43,4 @@ export const zipClient = makeZipper(clientDestDirectory, "Client");
export const zipLang = makeZipper(langDestDirectory, "Lang");
export const zipMMC = makeZipper(mmcDestDirectory, "MMC");
export const zipAll = gulp.series(zipServer, zipClient, zipLang, zipMMC);
export const zipAll = gulp.parallel(zipServer, zipClient, zipLang, zipMMC);

View File

@ -131,10 +131,12 @@ import transformVersion from "./transformVersion";
import { createBuildChangelog } from "../changelog/createChangelog";
import mustache from "mustache";
import log from "fancy-log";
import { updateFilesBuild } from "../misc/transformFiles";
export default gulp.series(
sharedCleanUp,
createSharedDirs,
updateFilesBuild,
copyOverrides,
fetchOrMakeChangelog,
fetchExternalDependencies,

View File

@ -25,6 +25,4 @@ export default async function transformManifestVersion(): Promise<void> {
} else {
modpackManifest.version = "manual-build";
}
modpackManifest.name = "";
}

View File

@ -9,9 +9,9 @@ body:
id: version
attributes:
label: Nomi CEu Version
description: The version of Nomi CEu you were using when this bug was encountered. If you do not know what it is, check the title of your instance window. If you do not see your version here, please update to the newest version of the pack, which currently is 1.6, or the newest alpha/beta, which currently is 1.6.1-beta-2.
description: The version of Nomi CEu you were using when this bug was encountered. If you do not know what it is, check the title of your instance window. If you do not see your version here, please update to the newest alpha, beta or release of the pack.
options:
{{versions}}
{{{versions}}}
validations:
required: true
@ -74,14 +74,17 @@ body:
id: reproduction
attributes:
label: Reproduction Steps
description: "How do you trigger this bug? Please walk us through it step by step."
description: |
How do you trigger this bug? Please walk us through it step by step.
Please leave this field blank if this is not applicable. (Quest Isuses, JEI Issues, Tooltip Issues, etc.)
placeholder: |
1.
2.
3.
...
validations:
required: true
required: false
- type: textarea
id: logs
attributes:

View File

@ -9,9 +9,9 @@ body:
id: version
attributes:
label: Nomi CEu Version
description: The version of Nomi CEu you are using as the basis for this feature request. If you do not know what it is, check the title of your instance window. If you do not see your version here, please update to the newest version of the pack, which currently is 1.6, or the newest alpha/beta, which currently is 1.6.1-beta-2.
description: The version of Nomi CEu you are using as the basis for this feature request. If you do not know what it is, check the title of your instance window. f you do not see your version here, please update to the newest alpha, beta or release of the pack.
options:
{{versions}}
{{{versions}}}
validations:
required: true

View File

@ -78,7 +78,7 @@
"alignment": "left_center",
"action": {
"type": "openLink",
"link": "https://github.com/Nomi-CEu/Nomi-CEu/releases/tag/{{version}}"
"link": "https://github.com/Nomi-CEu/Nomi-CEu/releases/tag/{{{version}}}"
}
},
"discord": {

View File

@ -110,7 +110,7 @@ client {
# The Minecraft window title.
# Default: Minecraft 1.12.2
S:title=Nomifactory CEu, v{{version}}, {{mode}} Mode
S:title=Nomifactory CEu, {{{versionTitle}}}, {{mode}} Mode
}
}

View File

@ -27,6 +27,6 @@ max-players=20
spawn-monsters=true
view-distance=10
generate-structures=true
motd=Nomi CEu Server, v{{version}}, Expert Mode
motd=Nomi CEu Server, {{{versionTitle}}}, Expert Mode
level-type=lostcities
generator-settings=

View File

@ -27,6 +27,6 @@ max-players=20
spawn-monsters=true
view-distance=10
generate-structures=true
motd=Nomi CEu Server, v{{version}}, Normal Mode
motd=Nomi CEu Server, {{{versionTitle}}}, Normal Mode
level-type=lostcities
generator-settings=

View File

@ -0,0 +1,46 @@
export type BuildType = "GITHUB_TAG" | "HEAD_REF" | "GITHUB_SHA" | "MANUAL_BUILD";
export class BuildData {
public type: BuildType;
public transformedVersion: string;
public rawVersion: string;
constructor() {
// We're building a tag/version.
if (process.env.GITHUB_TAG) {
this.type = "GITHUB_TAG";
this.rawVersion = process.env.GITHUB_TAG.replace(/^v/, "");
this.transformedVersion =
process.env.GITHUB_TAG.search(/^v/) === -1 ? `v${process.env.GITHUB_TAG}` : process.env.GITHUB_TAG;
}
// If Pull Request Branch Name is provided and a 'True SHA' is provided
else if (process.env.GITHUB_HEAD_REF && process.env.TRUE_SHA) {
const shortCommit = process.env.TRUE_SHA.substring(0, 7);
this.type = "HEAD_REF";
this.rawVersion = `${process.env.GITHUB_HEAD_REF}-${shortCommit}`;
this.transformedVersion = `PR Build (${process.env.GITHUB_HEAD_REF} branch, ${shortCommit})`;
}
// If SHA and ref is provided, append both the branch and short SHA.
else if (process.env.GITHUB_SHA && process.env.GITHUB_REF && process.env.GITHUB_REF.startsWith("refs/heads/")) {
const shortCommit = process.env.GITHUB_SHA.substring(0, 7);
const branch = /refs\/heads\/(.+)/.exec(process.env.GITHUB_REF)?.[1];
if (!branch) {
throw new Error(`Invalid git ref: ${process.env.GITHUB_REF}`);
}
this.type = "GITHUB_SHA";
this.rawVersion = `${branch}-${shortCommit}`;
this.transformedVersion = `Nightly Build (${branch} branch, ${shortCommit})`;
}
// Manual Build
else {
this.type = "MANUAL_BUILD";
this.rawVersion = "manual-build";
this.transformedVersion = "Manual Build";
}
}
public isVersionBuild(): boolean {
return this.type === "GITHUB_TAG";
}
}

View File

@ -149,9 +149,9 @@ export async function downloadOrRetrieveFileDef(fileDef: FileDef): Promise<Retri
export async function downloadFileDef(fileDef: FileDef): Promise<Buffer> {
let hashFailed = false;
const retryStrategy = (err: Error, response: http.IncomingMessage, body: unknown) => {
if (response.statusCode === 404) {
throw new Error(`URL ${fileDef.url} returned status 404.`);
}
if (!response) return requestretry.RetryStrategies.HTTPOrNetworkError(err, response, body);
if (response.statusCode === 404) throw new Error(`URL ${fileDef.url} returned status 404.`);
// Verify hashes.
if (!err && fileDef.hashes && body) {
const success = fileDef.hashes.every((hashDef) => {