Skip to content

Add Extension

Add Extension #114

Workflow file for this run

# This is a basic workflow that is manually triggered
name: Add Extension
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
modid:
description: 'Extension modid to add i.e. 598'
default: ''
required: true
type: string
type:
type: choice
description: Type of extension to add
required: true
default: 'game'
options:
- game
- theme
- translation
- tool
gamedomain:
description: 'REQUIRED FOR GAME TYPE: Site game domain that this extension manages i.e. back4blood'
default: ''
required: false
type: string
language:
description: 'REQUIRED FOR LANGUAGE TYPE: Language tag for this extension i.e. en-GB'
default: ''
required: false
type: string
dry-run:
description: "Dry run?"
required: true
type: boolean
default: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job
Add-Extension:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
DRY_RUN: ${{ !!(inputs.dry-run) }}
NEXUS_APIKEY: ${{ secrets.NEXUS_APIKEY }}
SLACK_SIGNING_SECRET: ${{ secrets.SLACK_SIGNING_SECRET }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
EXT_MODID: ${{ inputs.modid }}
EXT_TYPE: ${{ inputs.type }}
EXT_GAMEDOMAIN: ${{ inputs.gamedomain }}
EXT_LANGUAGE_CODE: ${{ inputs.language }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Show Inputs
run: echo "${{ toJSON(github.event.inputs) }}"
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run
run: yarn add-extension
# commit and push if not dry run
- name: Git commit and push
if: ${{ env.DRY_RUN == 'false' }}
env:
CI_COMMIT_AUTHOR: Vortex Backend
CI_COMMIT_EMAIL: [email protected]
CI_COMMIT_MESSAGE: Update Extensions Manifest
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git pull
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push