Removal of MMC Zips (#566)

[SKIP]
This commit is contained in:
Integer Limit 2023-12-09 12:14:06 +11:00 committed by GitHub
parent 794dd5412a
commit 0414b24913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 129 additions and 97 deletions

View File

@ -34,7 +34,7 @@ on:
required: false
type: string
separate_upload:
description: Whether to uploaed each zip (Client, Server, Lang & MMC) and the changelogs seperately. If not set, will just upload all six files into one artifact (Built Pack).
description: Whether to uploaed each zip (Client, Server, Lang) and the changelogs seperately. If not set, will just upload all six files into one artifact (Built Pack).
required: true
type: boolean
@ -259,7 +259,6 @@ jobs:
- name: Upload Client Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: ${{ needs.makeNames.outputs.client }}
path: ./build/client/**/*
@ -324,77 +323,11 @@ jobs:
- name: Upload Server Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
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
@ -454,7 +387,6 @@ jobs:
- name: Upload Lang Zip
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: ${{ needs.makeNames.outputs.lang }}
path: ./build/lang/**/*
@ -462,7 +394,6 @@ jobs:
- name: Upload Changelogs
uses: actions/upload-artifact@v3
if: ${{ inputs.separate_upload }}
with:
name: Changelogs
path: ./build/*.md

View File

@ -18,12 +18,52 @@ permissions:
contents: read
jobs:
build:
makeNames:
# Only continue if we are in base Nomi-CEu Repo and pull request is from fork
if: "${{ github.repository_owner == 'Nomi-CEu' && github.event.pull_request.head.repo.owner.login != 'Nomi-CEu' }}"
name: Fork PR Build Pack
name: Make Fork PR Artifact Names (${{ github.event.pull_request.head.sha }})
runs-on: ubuntu-latest
environment: fork-pr-build-pack
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
TRUE_SHA: ${{ github.event.pull_request.head.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: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
# Don't use cache to prevent cache poisoning
- 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: Make Artifact Names
id: artifactNames
working-directory: ./tools
run: npx gulp makeArtifactNames
buildClient:
# Only continue if we are in base Nomi-CEu Repo and pull request is from fork
if: "${{ github.repository_owner == 'Nomi-CEu' && github.event.pull_request.head.repo.owner.login != 'Nomi-CEu' }}"
name: Build Fork PR Client (${{ github.event.pull_request.head.sha }})
runs-on: ubuntu-latest
environment: fork-pr-build-pack
needs: makeNames
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
TRUE_SHA: ${{ github.event.pull_request.head.sha }}
@ -36,7 +76,7 @@ jobs:
persist-credentials: false
# Don't use cache to prevent cache poisoning
- name: Setup NodeJS v16
uses: actions/setup-node@v3
with:
@ -47,42 +87,103 @@ jobs:
working-directory: ./tools
run: npm ci
- name: Build Pack
- name: Build Client
working-directory: ./tools
run: npx gulp buildAll
run: npx gulp buildClient
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Zip Pack
working-directory: ./tools
run: npx gulp zipAll
- name: Upload Client Zip
uses: actions/upload-artifact@v3
with:
name: Client Zip
path: ./build/*-client.zip
name: ${{ needs.makeNames.outputs.client }}
path: ./build/client/**/*
if-no-files-found: error
buildServer:
# Only continue if we are in base Nomi-CEu Repo and pull request is from fork
if: "${{ github.repository_owner == 'Nomi-CEu' && github.event.pull_request.head.repo.owner.login != 'Nomi-CEu' }}"
name: Build Fork PR Server (${{ github.event.pull_request.head.sha }})
runs-on: ubuntu-latest
environment: fork-pr-build-pack
needs: makeNames
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
TRUE_SHA: ${{ github.event.pull_request.head.sha }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
# Don't use cache to prevent cache poisoning
- 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: Build Server
working-directory: ./tools
run: npx gulp buildServer
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Upload Server Zip
uses: actions/upload-artifact@v3
with:
name: Server Zip
path: ./build/*-server.zip
name: ${{ needs.makeNames.outputs.server }}
path: ./build/server/**/*
if-no-files-found: error
buildLang:
# Only continue if we are in base Nomi-CEu Repo and pull request is from fork
if: "${{ github.repository_owner == 'Nomi-CEu' && github.event.pull_request.head.repo.owner.login != 'Nomi-CEu' }}"
name: Build Fork PR Lang and Changelogs (${{ github.event.pull_request.head.sha }})
runs-on: ubuntu-latest
environment: fork-pr-build-pack
needs: makeNames
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}
TRUE_SHA: ${{ github.event.pull_request.head.sha }}
steps:
- name: Checkout Ref
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
# Don't use cache to prevent cache poisoning
- 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: Build Lang and Changelogs
working-directory: ./tools
run: npx gulp buildLang
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: Upload Lang Zip
uses: actions/upload-artifact@v3
with:
name: Lang Zip
path: ./build/*-lang.zip
if-no-files-found: error
- name: Upload MMC Zip
uses: actions/upload-artifact@v3
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

@ -27,8 +27,8 @@ export const buildServer = gulp.series(gulp.parallel(sharedTasks, modTasks), ser
export const buildLang = gulp.series(sharedTasks, langTasks);
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),
sharedTasks,
gulp.parallel(clientTasks, langTasks, gulp.series(modTasks, serverTasks)),
);
import checkTasks from "./tasks/checks";

View File

@ -26,7 +26,7 @@ async function deployReleases(): Promise<void> {
});
const body = makeArtifactNameBody(modpackManifest.name);
const files = ["client", "server", "lang", "mmc"].map((file) => sanitize(`${body}-${file}.zip`.toLowerCase()));
const files = ["client", "server", "lang"].map((file) => sanitize(`${body}-${file}.zip`.toLowerCase()));
/**
* Obligatory file check.

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.parallel(zipServer, zipClient, zipLang, zipMMC);
export const zipAll = gulp.parallel(zipServer, zipClient, zipLang);