modded7/.github/workflows/deploycfrc.yml
2023-05-19 21:10:56 +10:00

84 lines
2.5 KiB
YAML

name: Deploy to CurseForge (RC)
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to checkout'
required: true
default: 'main'
version:
description: 'RC version to deploy (e. g. "v1.3")'
required: true
flavorTitle:
description: 'Flavor title (e. g. "Community Update")'
required: false
jobs:
deploy:
name: Deploy to CurseForge (RC) (${{ github.event.inputs.version }})
runs-on: ubuntu-latest
env:
GITHUB_BRANCH: ${{ github.event.inputs.branch }}
RC_VERSION: ${{ github.event.inputs.version }}
BUILD_FLAVOR_TITLE: ${{ github.event.inputs.flavorTitle }}
steps:
- name: "Checkout code"
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag }}
- name: "Restore cached files"
uses: actions/cache@v2
id: cache
with:
path: |
~/.npm
./.cache
./buildtools/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@v2
with:
node-version: "16"
check-latest: true
- name: "Download NPM packages"
working-directory: ./buildtools
run: npm ci
- name: "Check environmental variables"
working-directory: ./buildtools
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: ./buildtools
run: npx gulp buildAll
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: "Prune cache"
working-directory: ./buildtools
run: npx gulp pruneCache
env:
CFCORE_API_TOKEN: ${{ secrets.CFCORE_API_TOKEN }}
- name: "Zip everything"
working-directory: ./buildtools
run: npx gulp zipAll
- name: "Deploy to CurseForge"
env:
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
working-directory: ./buildtools
run: npx gulp deployCurseForgeBeta