mirror of
https://github.com/Ryujinx/Ryujinx-Mako.git
synced 2025-08-17 16:21:58 +00:00
Create multiple actions to make Mako easier to use
This commit is contained in:
parent
09cd87917d
commit
c67b7c75b3
20
.github/actions/execute-command/README.md
vendored
Normal file
20
.github/actions/execute-command/README.md
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# execute-command
|
||||||
|
|
||||||
|
A small composite action to run the specified Mako subcommand.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Add the following step to your workflow:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
- name: Execute Ryujinx-Mako command
|
||||||
|
uses: Ryujinx/Ryujinx-Mako/.github/actions/execute-command@master
|
||||||
|
with:
|
||||||
|
command: "<a valid subcommand for Mako>"
|
||||||
|
args: "<subcommand args>"
|
||||||
|
app_id: ${{ secrets.MAKO_APP_ID }}
|
||||||
|
private_key: ${{ secrets.MAKO_PRIVATE_KEY }}
|
||||||
|
installation_id: ${{ secrets.MAKO_INSTALLATION_ID }}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
29
.github/actions/execute-command/action.yml
vendored
Normal file
29
.github/actions/execute-command/action.yml
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: 'Mako command'
|
||||||
|
description: 'Execute a Mako subcommand'
|
||||||
|
inputs:
|
||||||
|
command:
|
||||||
|
description: 'Subcommand to execute with Mako'
|
||||||
|
required: true
|
||||||
|
args:
|
||||||
|
description: 'Arguments for the specified subcommand'
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
app_id:
|
||||||
|
description: 'GitHub App ID'
|
||||||
|
required: true
|
||||||
|
private_key:
|
||||||
|
description: 'Private key for the GitHub App'
|
||||||
|
required: true
|
||||||
|
installation_id:
|
||||||
|
description: 'GitHub App Installation ID'
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- run: |
|
||||||
|
poetry -n -C "${{ github.action_path }}../" run ryujinx-mako ${{ inputs.command }} ${{ inputs.args }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
MAKO_APP_ID: ${{ inputs.app_id }}
|
||||||
|
MAKO_PRIVATE_KEY: ${{ inputs.private_key }}
|
||||||
|
MAKO_INSTALLATION_ID: ${{ inputs.installation_id }}
|
11
.github/actions/setup-mako/README.md
vendored
11
.github/actions/setup-mako/README.md
vendored
|
@ -6,18 +6,11 @@ It installs poetry and all module dependencies.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Add the following steps to your workflow:
|
Add the following step to your workflow:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Checkout Ryujinx-Mako
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: Ryujinx/Ryujinx-Mako
|
|
||||||
ref: master
|
|
||||||
path: ".ryujinx-mako"
|
|
||||||
|
|
||||||
- name: Setup Ryujinx-Mako
|
- name: Setup Ryujinx-Mako
|
||||||
uses: .ryujinx-mako/.github/actions/setup-mako
|
uses: Ryujinx/Ryujinx-Mako/.github/actions/setup-mako@master
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
6
.github/actions/setup-mako/action.yml
vendored
6
.github/actions/setup-mako/action.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
name: 'Setup Ryujinx-Mako'
|
name: 'Setup Mako'
|
||||||
description: 'Setup the environment for Ryujinx-Mako'
|
description: 'Setup the environment for Mako'
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
|
@ -7,6 +7,6 @@ runs:
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
cd .ryujinx-mako
|
cd "${{ github.action_path }}/../"
|
||||||
poetry install --only main
|
poetry install --only main
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
31
README.md
31
README.md
|
@ -4,32 +4,17 @@ A custom GitHub App to aid Ryujinx with project management and moderation
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Add the following steps to your workflow:
|
Add the following step to your workflow:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
- name: Checkout Ryujinx-Mako
|
- name: Run Ryujinx-Mako
|
||||||
uses: actions/checkout@v3
|
uses: Ryujinx/Ryujinx-Mako@master
|
||||||
with:
|
with:
|
||||||
repository: Ryujinx/Ryujinx-Mako
|
command: <Mako subcommand>
|
||||||
ref: master
|
args: <subcommand args>
|
||||||
path: '.ryujinx-mako'
|
app_id: ${{ secrets.MAKO_APP_ID }}
|
||||||
|
private_key: ${{ secrets.MAKO_PRIVATE_KEY }}
|
||||||
- name: Setup Ryujinx-Mako
|
installation_id: ${{ secrets.MAKO_INSTALLATION_ID }}
|
||||||
uses: ./.ryujinx-mako/.github/actions/setup-mako
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Execute the available commands like this:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
- name: Setup git identity for Ryujinx-Mako
|
|
||||||
run: |
|
|
||||||
# poetry -n -C .ryujinx-mako run ryujinx-mako <command> [<args>]
|
|
||||||
# for example:
|
|
||||||
poetry -n -C .ryujinx-mako run ryujinx-mako setup-git
|
|
||||||
env:
|
|
||||||
MAKO_APP_ID: ${{ secrets.MAKO_APP_ID }}
|
|
||||||
MAKO_PRIVATE_KEY: ${{ secrets.MAKO_PRIVATE_KEY }}
|
|
||||||
MAKO_INSTALLATION_ID: ${{ secrets.MAKO_INSTALLATION_ID }}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Available commands
|
## Available commands
|
||||||
|
|
47
action.yml
Normal file
47
action.yml
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
name: 'Run Ryujinx-Mako'
|
||||||
|
description: 'Setup Mako and execute the specified subcommand'
|
||||||
|
inputs:
|
||||||
|
command:
|
||||||
|
description: 'Subcommand to execute with Mako'
|
||||||
|
required: true
|
||||||
|
args:
|
||||||
|
description: 'Arguments for the specified subcommand'
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
app_id:
|
||||||
|
description: 'GitHub App ID'
|
||||||
|
required: true
|
||||||
|
private_key:
|
||||||
|
description: 'Private key for the GitHub App'
|
||||||
|
required: true
|
||||||
|
installation_id:
|
||||||
|
description: 'GitHub App Installation ID'
|
||||||
|
required: true
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Check if Mako was already setup
|
||||||
|
id: check_dest
|
||||||
|
run: |
|
||||||
|
[ -f "${{ github.action_path }}/.ryujinx-mako_setup-done" ] \
|
||||||
|
&& echo "exists=true" >> $GITHUB_OUTPUT \
|
||||||
|
|| echo "exists=false" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Setup Mako
|
||||||
|
if: steps.check_dest.outputs.exists == "false"
|
||||||
|
uses: ./.github/actions/setup-mako
|
||||||
|
|
||||||
|
- name: Create setup finished flag
|
||||||
|
if: steps.check_dest.outputs.exists == "false"
|
||||||
|
run: touch "${{ github.action_path }}/.ryujinx-mako_setup-done"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Run Mako subcommand
|
||||||
|
uses: ./.github/actions/execute-command
|
||||||
|
with:
|
||||||
|
command: ${{ inputs.command }}
|
||||||
|
args: ${{ inputs.args }}
|
||||||
|
app_id: ${{ inputs.app_id }}
|
||||||
|
private_key: ${{ inputs.private_key }}
|
||||||
|
installation_id: ${{ inputs.installation_id }}
|
Loading…
Reference in a new issue