From 4da564e7c20f7598deb09460aa53fbe5c09b4af4 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 24 Oct 2022 11:06:28 +0200 Subject: [PATCH 1/5] dependabot: Add github-actions --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 08d5808..6c2edbb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,3 +10,13 @@ updates: prefix: submodule schedule: interval: daily + + - directory: / + open-pull-requests-limit: 5 + package-ecosystem: github-actions + reviewers: + - spacemeowx2 + commit-message: + prefix: gha + schedule: + interval: weekly From 90a36660d614436a1988d59f3d5d9d04d24f95a3 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 24 Oct 2022 11:24:24 +0200 Subject: [PATCH 2/5] gha: Update github workflows --- .github/workflows/build.yml | 18 ++++++++++-------- .github/workflows/nightly.yml | 20 ++++++++++++-------- .github/workflows/release.yml | 24 ++++++++++++++---------- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 203382a..8ccec6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,29 +6,31 @@ jobs: build: runs-on: ubuntu-latest + container: + image: devkitpro/devkita64:latest + steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 with: submodules: true - - uses: spacemeowx2/devkitpro-action@v2 - with: - libnx-rev: 5ca15e7696e174c41ee94974d62602fde722ac3b - cmd: make -j8 + + - name: Build + run: make -j8 - name: Upload built files - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: sdcard path: out/sd - name: Upload elf file - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: ldn_mitm.elf path: ldn_mitm/ldn_mitm.elf - name: Upload elf file - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: ldn_mitm.elf path: overlay/overlay.elf diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1b791fe..506857d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -8,34 +8,38 @@ jobs: build: runs-on: ubuntu-latest + container: + image: devkitpro/devkita64:latest + steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 with: submodules: true + - name: update Atmosphere-libs run: | pushd Atmosphere-libs + git fetch --all git reset --hard origin/master popd - - uses: spacemeowx2/devkitpro-action@v2 - with: - libnx-rev: master - cmd: make -j8 + + - name: Build + run: make -j8 - name: Upload built files - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: sdcard path: out/sd - name: Upload elf file - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: ldn_mitm.elf path: ldn_mitm/ldn_mitm.elf - name: Upload elf file - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: ldn_mitm.elf path: overlay/overlay.elf diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c88f66..68b5ea7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,25 +9,28 @@ jobs: build: runs-on: ubuntu-latest + container: + image: devkitpro/devkita64:latest + steps: - name: Set env - run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' - - uses: actions/checkout@v1 + run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV + + - uses: actions/checkout@v3 with: submodules: true - - uses: spacemeowx2/devkitpro-action@v2 - with: - libnx-rev: 9865dbf92177c358b88fa7542b628d8a8a2a9d74 - cmd: make -j8 + + - name: Build + run: make -j8 + - name: Pack run: | cd ./out/sd sudo zip -r ./ldn_mitm_${{ env.RELEASE_VERSION }}.zip atmosphere switch + - name: Create Release id: create_release - uses: actions/create-release@v1 + uses: actions/create-release@v1.1.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -35,9 +38,10 @@ jobs: release_name: ${{ env.RELEASE_VERSION }} draft: false prerelease: false + - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1.0.1 + uses: actions/upload-release-asset@v1.0.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: From 292de930bd6f51c5edd275abb538b8d0f20e42e7 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 24 Oct 2022 11:37:02 +0200 Subject: [PATCH 3/5] gha: Add step to retry building with libnx master --- .github/workflows/build.yml | 15 +++++++++++++++ .github/workflows/nightly.yml | 15 +++++++++++++++ .github/workflows/release.yml | 15 +++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ccec6b..e0f388d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,10 @@ jobs: container: image: devkitpro/devkita64:latest + defaults: + run: + shell: bash + steps: - uses: actions/checkout@v3 with: @@ -17,6 +21,17 @@ jobs: - name: Build run: make -j8 + - name: Install libnx master & Retry build + if: ${{ failure() }} + run: | + pushd /tmp + git clone https://github.com/switchbrew/libnx + cd libnx + make -j8 + make install + popd + make -j8 + - name: Upload built files uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 506857d..e42da3c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -11,6 +11,10 @@ jobs: container: image: devkitpro/devkita64:latest + defaults: + run: + shell: bash + steps: - uses: actions/checkout@v3 with: @@ -26,6 +30,17 @@ jobs: - name: Build run: make -j8 + - name: Install libnx master & Retry build + if: ${{ failure() }} + run: | + pushd /tmp + git clone https://github.com/switchbrew/libnx + cd libnx + make -j8 + make install + popd + make -j8 + - name: Upload built files uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68b5ea7..e82ba88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,10 @@ jobs: container: image: devkitpro/devkita64:latest + defaults: + run: + shell: bash + steps: - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV @@ -22,6 +26,17 @@ jobs: - name: Build run: make -j8 + + - name: Install libnx master & Retry build + if: ${{ failure() }} + run: | + pushd /tmp + git clone https://github.com/switchbrew/libnx + cd libnx + make -j8 + make install + popd + make -j8 - name: Pack run: | From cd43ed90d55bcd453d08d8fe09d13f9b84aa37f9 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:03:26 +0200 Subject: [PATCH 4/5] gha: Add ccache to speed up builds --- .github/workflows/build.yml | 9 ++++++--- .github/workflows/nightly.yml | 9 ++++++--- .github/workflows/release.yml | 9 ++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0f388d..b6a750a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,11 @@ jobs: with: submodules: true + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 + - name: Build - run: make -j8 + run: make -j8 PREFIX="ccache aarch64-none-elf-" - name: Install libnx master & Retry build if: ${{ failure() }} @@ -27,10 +30,10 @@ jobs: pushd /tmp git clone https://github.com/switchbrew/libnx cd libnx - make -j8 + make -j8 PREFIX="ccache aarch64-none-elf-" make install popd - make -j8 + make -j8 PREFIX="ccache aarch64-none-elf-" - name: Upload built files uses: actions/upload-artifact@v3 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e42da3c..3f79ada 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,6 +19,9 @@ jobs: - uses: actions/checkout@v3 with: submodules: true + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 - name: update Atmosphere-libs run: | @@ -28,7 +31,7 @@ jobs: popd - name: Build - run: make -j8 + run: make -j8 PREFIX="ccache aarch64-none-elf-" - name: Install libnx master & Retry build if: ${{ failure() }} @@ -36,10 +39,10 @@ jobs: pushd /tmp git clone https://github.com/switchbrew/libnx cd libnx - make -j8 + make -j8 PREFIX="ccache aarch64-none-elf-" make install popd - make -j8 + make -j8 PREFIX="ccache aarch64-none-elf-" - name: Upload built files uses: actions/upload-artifact@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e82ba88..79de037 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,9 +23,12 @@ jobs: - uses: actions/checkout@v3 with: submodules: true + + - name: Setup ccache + uses: hendrikmuhs/ccache-action@v1.2 - name: Build - run: make -j8 + run: make -j8 PREFIX="ccache aarch64-none-elf-" - name: Install libnx master & Retry build if: ${{ failure() }} @@ -33,10 +36,10 @@ jobs: pushd /tmp git clone https://github.com/switchbrew/libnx cd libnx - make -j8 + make -j8 PREFIX="ccache aarch64-none-elf-" make install popd - make -j8 + make -j8 PREFIX="ccache aarch64-none-elf-" - name: Pack run: | From 1de7a7d1d96755b4995988107cbd8cd222d718ad Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:10:55 +0200 Subject: [PATCH 5/5] gha: Continue after first build fails --- .github/workflows/build.yml | 5 ++++- .github/workflows/nightly.yml | 5 ++++- .github/workflows/release.yml | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6a750a..1872f83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,13 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2 - name: Build + id: build run: make -j8 PREFIX="ccache aarch64-none-elf-" + continue-on-error: true - name: Install libnx master & Retry build - if: ${{ failure() }} + id: retry + if: ${{ steps.build.outcome == 'failure' }} run: | pushd /tmp git clone https://github.com/switchbrew/libnx diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3f79ada..898a8b3 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -31,10 +31,13 @@ jobs: popd - name: Build + id: build run: make -j8 PREFIX="ccache aarch64-none-elf-" + continue-on-error: true - name: Install libnx master & Retry build - if: ${{ failure() }} + id: retry + if: ${{ steps.build.outcome == 'failure' }} run: | pushd /tmp git clone https://github.com/switchbrew/libnx diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 79de037..fe43c88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,13 @@ jobs: uses: hendrikmuhs/ccache-action@v1.2 - name: Build + id: build run: make -j8 PREFIX="ccache aarch64-none-elf-" + continue-on-error: true - name: Install libnx master & Retry build - if: ${{ failure() }} + id: retry + if: ${{ steps.build.outcome == 'failure' }} run: | pushd /tmp git clone https://github.com/switchbrew/libnx