2021-12-30 04:31:18 -06:00
|
|
|
name: citra-publish
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: '7 0 * * *'
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
nightly:
|
2021-12-31 22:57:50 -06:00
|
|
|
description: 'Whether to trigger a nightly build (true/false/auto)'
|
2021-12-30 04:31:18 -06:00
|
|
|
required: false
|
|
|
|
default: 'true'
|
|
|
|
canary:
|
2021-12-31 22:57:50 -06:00
|
|
|
description: 'Whether to trigger a canary build (true/false/auto)'
|
2021-12-30 04:31:18 -06:00
|
|
|
required: false
|
|
|
|
default: 'true'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
nightly:
|
|
|
|
runs-on: ubuntu-latest
|
2024-03-05 19:24:56 -06:00
|
|
|
if: ${{ github.event.inputs.nightly != 'false' && github.repository == 'RyzenDew/Lime-3DS-Emulator' }}
|
2021-12-30 04:31:18 -06:00
|
|
|
steps:
|
2021-12-31 20:14:23 -06:00
|
|
|
# this checkout is required to make sure the GitHub Actions scripts are available
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-31 20:14:23 -06:00
|
|
|
name: Pre-checkout
|
|
|
|
with:
|
|
|
|
submodules: false
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/github-script@v7
|
2021-12-30 04:31:18 -06:00
|
|
|
id: check-changes
|
|
|
|
name: 'Check for new changes'
|
2021-12-31 20:14:23 -06:00
|
|
|
env:
|
|
|
|
# 24 hours
|
|
|
|
DETECTION_TIME_FRAME: 86400000
|
2021-12-30 04:31:18 -06:00
|
|
|
with:
|
|
|
|
result-encoding: string
|
|
|
|
script: |
|
|
|
|
if (context.payload.inputs && context.payload.inputs.nightly === 'true') return true;
|
2021-12-31 20:14:23 -06:00
|
|
|
const checkBaseChanges = require('./.github/workflows/ci-merge.js').checkBaseChanges;
|
|
|
|
return checkBaseChanges(github, context);
|
2021-12-30 04:31:18 -06:00
|
|
|
- run: npm install execa@5
|
|
|
|
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-30 04:31:18 -06:00
|
|
|
name: Checkout
|
|
|
|
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
|
|
|
with:
|
|
|
|
path: 'citra-merge'
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/github-script@v7
|
2021-12-30 04:31:18 -06:00
|
|
|
name: 'Update and tag new commits'
|
|
|
|
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const execa = require("execa");
|
|
|
|
const tagAndPush = require('./.github/workflows/ci-merge.js').tagAndPush;
|
|
|
|
process.chdir('${{ github.workspace }}/citra-merge');
|
|
|
|
tagAndPush(github, context.repo.owner, `${context.repo.repo}-nightly`, execa);
|
|
|
|
canary:
|
|
|
|
runs-on: ubuntu-latest
|
2024-03-05 19:24:56 -06:00
|
|
|
if: ${{ github.event.inputs.canary != 'false' && github.repository == 'RyzenDew/Lime-3DS-Emulator' }}
|
2021-12-30 04:31:18 -06:00
|
|
|
steps:
|
|
|
|
# this checkout is required to make sure the GitHub Actions scripts are available
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-30 04:31:18 -06:00
|
|
|
name: Pre-checkout
|
|
|
|
with:
|
|
|
|
submodules: false
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/github-script@v7
|
2021-12-30 04:31:18 -06:00
|
|
|
id: check-changes
|
|
|
|
name: 'Check for new changes'
|
2021-12-31 20:14:23 -06:00
|
|
|
env:
|
|
|
|
# 24 hours
|
|
|
|
DETECTION_TIME_FRAME: 86400000
|
2021-12-30 04:31:18 -06:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
if (context.payload.inputs && context.payload.inputs.canary === 'true') return true;
|
|
|
|
const checkCanaryChanges = require('./.github/workflows/ci-merge.js').checkCanaryChanges;
|
|
|
|
return checkCanaryChanges(github, context);
|
|
|
|
- run: npm install execa@5
|
|
|
|
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-30 04:31:18 -06:00
|
|
|
name: Checkout
|
|
|
|
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
|
|
|
with:
|
|
|
|
path: 'citra-merge'
|
|
|
|
fetch-depth: 0
|
|
|
|
submodules: true
|
|
|
|
token: ${{ secrets.ALT_GITHUB_TOKEN }}
|
2024-02-18 10:23:15 -06:00
|
|
|
- uses: actions/github-script@v7
|
2021-12-30 04:31:18 -06:00
|
|
|
name: 'Check and merge canary changes'
|
|
|
|
if: ${{ steps.check-changes.outputs.result == 'true' }}
|
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const execa = require("execa");
|
|
|
|
const mergebot = require('./.github/workflows/ci-merge.js').mergebot;
|
|
|
|
process.chdir('${{ github.workspace }}/citra-merge');
|
|
|
|
mergebot(github, context, execa);
|