Build #94
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
target: | |
description: "Build what" | |
required: true | |
default: "build-all" | |
type: choice | |
options: | |
- build-client | |
- build-server | |
- build-all | |
version: | |
description: "Version" | |
required: true | |
default: "Development Build" | |
type: string | |
workflow_call: | |
inputs: | |
target: | |
required: true | |
default: "build-all" | |
type: string | |
version: | |
required: true | |
type: string | |
secrets: | |
API_TOKEN: | |
required: true | |
jobs: | |
pack_pr: | |
if: ( !contains(github.event.head_commit.message, '[ci skip]') ) | |
name: Pack PR | |
runs-on: ubuntu-22.04 | |
concurrency: | |
group: pack_pr-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup node and npm | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 23 | |
cache: 'npm' | |
cache-dependency-path: tools/build/package-lock.json | |
- name: Restore mods cache | |
uses: actions/cache@v4 | |
with: | |
# observe if this makes broken builds due to outdated mods (server onl) | |
path: | | |
dist/modcache | |
dist/cache.json | |
key: ${{ runner.os }}-mods-${{ hashFiles('manifest.json') }} | |
restore-keys: | | |
${{ runner.os }}-mods- | |
- name: Restore modlist cache | |
uses: actions/cache@v4 | |
with: | |
path: dist/modlist.html | |
key: ${{ runner.os }}-modlist-${{ hashFiles('manifest.json') }} | |
restore-keys: | | |
${{ runner.os }}-modlist- | |
- name: Replace manifest version | |
run: | |
sed -i s/\"version\":\ \"development\"/\"version\":\ \"${{ inputs.version }}\"/ manifest.json | |
shell: bash | |
- name: Pack Modpack | |
env: | |
CFCORE_API_TOKEN: ${{ secrets.API_TOKEN }} | |
run: | | |
./pack-mode-switcher.sh n | |
cd tools/build | |
npm install | |
node . ${{ inputs.target }} | |
shell: bash | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-zipzip | |
path: dist/*.zip | |
if-no-files-found: error | |
overwrite: true | |
compression-level: 0 |