Lime3DS/.github/workflows/publish.yml

60 lines
2.1 KiB
YAML
Raw Normal View History

name: citra-publish
on:
schedule:
- cron: '7 0 * * *'
workflow_dispatch:
inputs:
nightly:
2022-01-01 05:57:50 +01:00
description: 'Whether to trigger a nightly build (true/false/auto)'
required: false
default: 'true'
canary:
2022-01-01 05:57:50 +01:00
description: 'Whether to trigger a canary build (true/false/auto)'
required: false
default: 'true'
jobs:
nightly:
runs-on: ubuntu-latest
2024-03-06 02:24:56 +01:00
if: ${{ github.event.inputs.nightly != 'false' && github.repository == 'RyzenDew/Lime-3DS-Emulator' }}
steps:
# this checkout is required to make sure the GitHub Actions scripts are available
2024-02-18 17:23:15 +01:00
- uses: actions/checkout@v4
name: Pre-checkout
with:
submodules: false
2024-02-18 17:23:15 +01:00
- uses: actions/github-script@v7
id: check-changes
name: 'Check for new changes'
env:
# 24 hours
DETECTION_TIME_FRAME: 86400000
with:
result-encoding: string
script: |
if (context.payload.inputs && context.payload.inputs.nightly === 'true') return true;
const checkBaseChanges = require('./.github/workflows/ci-merge.js').checkBaseChanges;
return checkBaseChanges(github, context);
- run: npm install execa@5
if: ${{ steps.check-changes.outputs.result == 'true' }}
2024-02-18 17:23:15 +01:00
- uses: actions/checkout@v4
name: Checkout
if: ${{ steps.check-changes.outputs.result == 'true' }}
with:
path: 'citra-merge'
fetch-depth: 0
submodules: true
2024-03-06 02:37:11 +01:00
token: ${{ secrets.BUILD_MAGIC }}
2024-02-18 17:23:15 +01:00
- uses: actions/github-script@v7
name: 'Update and tag new commits'
if: ${{ steps.check-changes.outputs.result == 'true' }}
2024-03-06 02:36:23 +01:00
env:
ALT_GITHUB_TOKEN: ${{ secrets.BUILD_MAGIC }}
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);