diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eafb98a3..01fac2dab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,6 @@ name: Release job on: workflow_dispatch: - inputs: {} push: branches: [ stable ] paths-ignore: diff --git a/.github/workflows/release-stage.yml b/.github/workflows/release_stage.yml similarity index 99% rename from .github/workflows/release-stage.yml rename to .github/workflows/release_stage.yml index 943a8169c..8fcd03106 100644 --- a/.github/workflows/release-stage.yml +++ b/.github/workflows/release_stage.yml @@ -2,7 +2,6 @@ name: Release staging build on: workflow_dispatch: - inputs: {} push: branches: [ master ] paths-ignore: diff --git a/.github/workflows/update_stable.yml b/.github/workflows/update_stable.yml new file mode 100644 index 000000000..7eb4ab27e --- /dev/null +++ b/.github/workflows/update_stable.yml @@ -0,0 +1,44 @@ +name: Update stable branch + +on: + workflow_dispatch: + schedule: + # Daily at 14:20 UTC + - cron: "20 14 * * *" + +jobs: + update_stable: + runs-on: ubuntu-latest + + env: + GIT_COMMITTER_NAME: "RyujinxBot" + GIT_COMMITTER_EMAIL: "61127645+RyujinxBot@users.noreply.github.com" + + steps: + - uses: actions/checkout@v3 + with: + ref: stable + fetch-depth: 0 + token: ${{ secrets.RYUJINX_BOT_PAT }} + + - name: Get version info + id: version_info + run: | + echo "git_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + + - name: Check for changes + id: check + run: | + echo "no_changes="gh api /repos/$REPO/commits/$COMMIT/branches-where-head --jq 'any(.name == "master")' >> $GITHUB_OUTPUT + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + COMMIT: ${{ steps.version_info.outputs.git_hash }} + + - name: Merge changes from master + if: steps.check.outputs.no_changes == 'false' + run: | + git config user.name "${{ env.GIT_COMMITTER_NAME }}" + git config user.email "${{ env.GIT_COMMITTER_EMAIL }}" + git merge origin/master + git push