190 lines
5.8 KiB
YAML
190 lines
5.8 KiB
YAML
name: Build Pack
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: Tag to Checkout and Release.
|
|
required: false
|
|
type: string
|
|
release_type:
|
|
description: The Release Type.
|
|
required: true
|
|
type: choice
|
|
default: 'Release'
|
|
options:
|
|
- 'Release'
|
|
- 'Beta Release'
|
|
- 'Alpha Release'
|
|
- 'Cutting Edge Build'
|
|
changelog_url:
|
|
description: Where to download the Changelog File from. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
changelog_cf_url:
|
|
description: Where to download the CF Changelog File from. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
changelog_branch:
|
|
description: Branch to download changelog Files from. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
compare_tag:
|
|
description: Tag to compare to. See CONTRIBUTING.md for more information.
|
|
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).
|
|
required: true
|
|
type: boolean
|
|
|
|
workflow_call:
|
|
inputs:
|
|
tag:
|
|
description: Tag to Checkout and Release.
|
|
required: false
|
|
type: string
|
|
release_type:
|
|
description: The Release Type.
|
|
required: false
|
|
default: Release
|
|
type: string
|
|
changelog_url:
|
|
description: Where to download the Changelog File from. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
changelog_cf_url:
|
|
description: Where to download the CF Changelog File from. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
changelog_branch:
|
|
description: Branch to download changelog Files from. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
compare_tag:
|
|
description: Tag to compare to. See CONTRIBUTING.md for more information.
|
|
required: false
|
|
type: string
|
|
separate_upload:
|
|
description: Whether to uploaed each zip (Client, Server & Lang) and the changelogs seperately. If not set, will just upload all five files into one artifact (Built Pack).
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
head_ref:
|
|
type: string
|
|
required: false
|
|
true_sha:
|
|
type: string
|
|
required: false
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Pack (${{ inputs.tag }})
|
|
runs-on: ubuntu-latest
|
|
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 Pack
|
|
working-directory: ./tools
|
|
run: npx gulp buildAll
|
|
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: 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: |
|
|
./build/*.zip
|
|
./build/*.md
|
|
if-no-files-found: error
|
|
|
|
- name: Upload Client Zip
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ inputs.separate_upload }}
|
|
with:
|
|
name: Client Zip
|
|
path: ./build/*-client.zip
|
|
if-no-files-found: error
|
|
|
|
- name: Upload Server Zip
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ inputs.separate_upload }}
|
|
with:
|
|
name: Server Zip
|
|
path: ./build/*-server.zip
|
|
if-no-files-found: error
|
|
|
|
- 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
|
|
if-no-files-found: error
|
|
|
|
- name: Upload Changelogs
|
|
uses: actions/upload-artifact@v3
|
|
if: ${{ inputs.separate_upload }}
|
|
with:
|
|
name: Changelogs
|
|
path: ./build/*.md
|
|
if-no-files-found: error
|