modded7/.github/workflows/deploygh.yml

81 lines
2.3 KiB
YAML

name: "[NOT CALLABLE] Deploy To Github Releases"
on:
workflow_call:
inputs:
tag:
description: The Release Tag.
required: true
type: string
release_type:
description: The Release Type. This is the formatted version.
required: true
type: string
jobs:
deployGH:
name: Deploy to GitHub Releases (${{ inputs.tag }})
runs-on: ubuntu-latest
env:
GITHUB_TAG: ${{ inputs.tag }}
steps:
- name: Get Token
id: token
uses: peter-murray/workflow-application-token-action@v3
with:
application_id: ${{ secrets.APP_ID }}
application_private_key: ${{ secrets.APP_KEY }}
organization: Nomi-CEu
revoke_token: true
- name: Checkout Tag
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.tag }}
- name: Restore Cached Files
uses: actions/cache@v4
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@v4
with:
node-version: 20
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: Download Built Artifacts
uses: actions/download-artifact@v4
with:
name: Built Pack
path: ./build/
- name: Deploy to GitHub Releases
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
CURSEFORGE_PROJECT_ID: ${{ secrets.CURSEFORGE_PROJECT_ID }}
CURSEFORGE_API_TOKEN: ${{ secrets.CURSEFORGE_API_TOKEN }}
RELEASE_TYPE: ${{ inputs.release_type }}
working-directory: ./tools
run: npx gulp deployReleases