-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (82 loc) · 2.84 KB
/
add-extension.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# 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