From 94091e13802323014c4184cfc4f98ebb250c3f9b Mon Sep 17 00:00:00 2001 From: reggie Date: Wed, 2 Oct 2024 23:42:43 -0500 Subject: [PATCH] Reconstruct necessary action workflows & Dependabot rules (#17) --- .github/dependabot.yml | 40 +++++++++++++++++++++ .github/labeler.yml | 35 ++++++++++++++++++ .github/workflows/checks.yml | 6 ++-- .github/workflows/pr_triage.yml | 27 ++++++++++++++ .github/workflows/release.yml | 64 +++++++++++++++++---------------- 5 files changed, 137 insertions(+), 35 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/labeler.yml create mode 100644 .github/workflows/pr_triage.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2a5ff064 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,40 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly + labels: + - "infra" + reviewers: + - regginator + commit-message: + prefix: "ci" + + - package-ecosystem: nuget + directory: / + open-pull-requests-limit: 10 + schedule: + interval: daily + labels: + - "infra" + reviewers: + - regginator + commit-message: + prefix: nuget + groups: + Avalonia: + patterns: + - "*Avalonia*" + Silk.NET: + patterns: + - "Silk.NET*" + OpenTK: + patterns: + - "OpenTK*" + SixLabors: + patterns: + - "SixLabors*" + NUnit: + patterns: + - "NUnit*" diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000..cd7650a9 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,35 @@ +audio: +- changed-files: + - any-glob-to-any-file: 'src/Ryujinx.Audio*/**' + +cpu: +- changed-files: + - any-glob-to-any-file: ['src/ARMeilleure/**', 'src/Ryujinx.Cpu/**', 'src/Ryujinx.Memory/**'] + +gpu: +- changed-files: + - any-glob-to-any-file: ['src/Ryujinx.Graphics.*/**', 'src/Spv.Generator/**', 'src/Ryujinx.ShaderTools/**'] + +'graphics-backend:opengl': +- changed-files: + - any-glob-to-any-file: 'src/Ryujinx.Graphics.OpenGL/**' + +'graphics-backend:vulkan': +- changed-files: + - any-glob-to-any-file: ['src/Ryujinx.Graphics.Vulkan/**', 'src/Spv.Generator/**'] + +gui: +- changed-files: + - any-glob-to-any-file: ['src/Ryujinx/**', 'src/Ryujinx.UI.Common/**', 'src/Ryujinx.UI.LocaleGenerator/**', 'src/Ryujinx.Gtk3/**'] + +horizon: +- changed-files: + - any-glob-to-any-file: ['src/Ryujinx.HLE/**', 'src/Ryujinx.Horizon/**'] + +kernel: +- changed-files: + - any-glob-to-any-file: 'src/Ryujinx.HLE/HOS/Kernel/**' + +infra: +- changed-files: + - any-glob-to-any-file: ['.github/**', 'distribution/**', 'Directory.Packages.props'] diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 48757b56..3bcd8aee 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -46,16 +46,14 @@ jobs: # For some unknown reason this step sometimes fails with exit code 139 (segfault?), # so in that case we'll try again (3 tries max). - name: Run dotnet format style - uses: TSRBerry/unstable-commands@v1 + uses: ryujinx-mirror/unstable-commands@releases/v1.0.6 with: commands: dotnet format style --severity info --verify-no-changes --report ./style-report.json -v d timeout-minutes: 5 retry-codes: 139 - # For some unknown reason this step sometimes fails with exit code 139 (segfault?), - # so in that case we'll try again (3 tries max). - name: Run dotnet format analyzers - uses: TSRBerry/unstable-commands@v1 + uses: ryujinx-mirror/unstable-commands@releases/v1.0.6 with: commands: dotnet format analyzers --severity info --verify-no-changes --report ./analyzers-report.json -v d timeout-minutes: 5 diff --git a/.github/workflows/pr_triage.yml b/.github/workflows/pr_triage.yml new file mode 100644 index 00000000..1ac02906 --- /dev/null +++ b/.github/workflows/pr_triage.yml @@ -0,0 +1,27 @@ +name: "Pull Request Triage" +on: + pull_request_target: + types: [opened, ready_for_review] + +jobs: + triage: + runs-on: ubuntu-latest + + permissions: + contents: read + pull-requests: write + + steps: + - name: Fetch labeler.yml + uses: actions/checkout@v4 + with: + # Ensure we pin the source origin as pull_request_target run under forks. + fetch-depth: 0 + repository: ryujinx-mirror/ryujinx + ref: mirror/master + + - name: Update labels based on changes in PR + uses: actions/labeler@v5 + with: + sync-labels: true + dot: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7a86335..263b933c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,10 +17,12 @@ concurrency: release env: POWERSHELL_TELEMETRY_OPTOUT: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 - RYUJINX_BASE_VERSION: "1.1" - RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "mirror/master" - RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "ryujinx-mirror" - RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "ryujinx" + #RYUJINX_BASE_VERSION: "1.1" # NOTE: For now, releases for the fork will be named after Git revision hashes, this is ignored + + # Should be unnecessary for us, we're releasing in-repo + #RYUJINX_TARGET_RELEASE_CHANNEL_OWNER: "ryujinx-mirror" + #RYUJINX_TARGET_RELEASE_CHANNEL_REPO: "ryujinx" + #RYUJINX_TARGET_RELEASE_CHANNEL_NAME: "mirror/master" jobs: tag: @@ -30,7 +32,7 @@ jobs: - name: Get version info id: version_info run: | - echo "build_version=`echo r${{ github.sha }} | cut -c1-9`" >> $GITHUB_OUTPUT + echo "build_version=r`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_OUTPUT shell: bash - name: Create tag @@ -52,8 +54,8 @@ jobs: makeLatest: "true" omitBody: true omitBodyDuringUpdate: true - owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} - repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} + #owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} + #repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} token: ${{ secrets.GITHUB_TOKEN }} release: @@ -79,19 +81,19 @@ jobs: - name: Get version info id: version_info run: | - echo "build_version=`echo r${{ github.sha }} | cut -c1-9`" >> $GITHUB_OUTPUT + echo "build_version=r`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_OUTPUT echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT shell: bash - #- name: Configure for release - # run: | - # sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs - # shell: bash + - name: Configure for release + run: | + #sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ github.repository_owner }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ github.event.repository.name }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ github.ref_name }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs + shell: bash - name: Create output dir run: "mkdir release_output" @@ -142,8 +144,8 @@ jobs: omitBodyDuringUpdate: true allowUpdates: true replacesArtifacts: true - owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} - repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} + #owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} + #repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} token: ${{ secrets.GITHUB_TOKEN }} macos_release: @@ -177,18 +179,18 @@ jobs: - name: Get version info id: version_info run: | - echo "build_version=`echo r${{ github.sha }} | cut -c1-9`" >> $GITHUB_OUTPUT + echo "build_version=r`echo ${{ github.sha }} | cut -c1-8`" >> $GITHUB_OUTPUT echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT - #- name: Configure for release - # run: | - # sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_NAME }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }}/g;' src/Ryujinx.Common/ReleaseInformation.cs - # sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs - # shell: bash + - name: Configure for release + run: | + #sed -r --in-place 's/\%\%RYUJINX_BUILD_VERSION\%\%/${{ steps.version_info.outputs.build_version }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_BUILD_GIT_HASH\%\%/${{ steps.version_info.outputs.git_short_hash }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_OWNER\%\%/${{ github.repository_owner }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_REPO\%\%/${{ github.event.repository.name }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_TARGET_RELEASE_CHANNEL_NAME\%\%/${{ github.ref_name }}/g;' src/Ryujinx.Common/ReleaseInformation.cs + sed -r --in-place 's/\%\%RYUJINX_CONFIG_FILE_NAME\%\%/Config\.json/g;' src/Ryujinx.Common/ReleaseInformation.cs + shell: bash - name: Publish macOS Ryujinx run: | @@ -209,6 +211,6 @@ jobs: omitBodyDuringUpdate: true allowUpdates: true replacesArtifacts: true - owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} - repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} + #owner: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_OWNER }} + #repo: ${{ env.RYUJINX_TARGET_RELEASE_CHANNEL_REPO }} token: ${{ secrets.GITHUB_TOKEN }}