From bedf9cdd19239f5aed62242a09567c9b35994c6c Mon Sep 17 00:00:00 2001 From: Peter Galonza Date: Mon, 27 May 2024 00:26:45 +0300 Subject: [PATCH] refactor: use "Reusing workflows" --- .github/workflows/build-jobs.yaml | 23 +++++++++++++++++++++++ .github/workflows/build.yml | 19 ++----------------- .github/workflows/prerelease.yml | 24 ++---------------------- .github/workflows/release.yml | 22 ++-------------------- 4 files changed, 29 insertions(+), 59 deletions(-) create mode 100644 .github/workflows/build-jobs.yaml diff --git a/.github/workflows/build-jobs.yaml b/.github/workflows/build-jobs.yaml new file mode 100644 index 000000000..e4f1f53c2 --- /dev/null +++ b/.github/workflows/build-jobs.yaml @@ -0,0 +1,23 @@ +name: Build jobs + +on: + workflow_call: + +jobs: + build: + name: build + runs-on: ubuntu-latest + container: ghcr.io/${{ github.repository_owner }}/devkita64-atmosphere:latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build Atmosphere + run: | + source /opt/venv/bin/activate + git config --global --add safe.directory "*" + make + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: atmosphere-artifacts + path: ./out/nintendo_nx_arm64_armv8a/release/* \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef9ac1e02..cc8912c72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,20 +12,5 @@ defaults: shell: bash jobs: - build: - name: build - runs-on: ubuntu-latest - container: ghcr.io/${{ github.repository_owner }}/devkita64-atmosphere:latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Atmosphere - run: | - source /opt/venv/bin/activate - git config --global --add safe.directory "*" - make - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: atmosphere-artifacts - path: ./out/nintendo_nx_arm64_armv8a/release/* + build-workflow: + uses: ./.github/workflows/build-jobs.yaml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index aaf03d84d..5bd792b92 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -17,28 +17,8 @@ defaults: shell: bash jobs: - build: - name: build - runs-on: ubuntu-latest - container: ghcr.io/${{ github.repository_owner }}/devkita64-atmosphere:latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Build Atmosphere - run: | - source /opt/venv/bin/activate - git config --global --add safe.directory "*" - make - - name: Remove debug - run: rm ./out/nintendo_nx_arm64_armv8a/release/atmosphere-*-debug.zip - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: atmosphere-artifacts - path: ./out/nintendo_nx_arm64_armv8a/release/* - + build-workflow: + uses: ./.github/workflows/build-jobs.yaml create-prerelease: runs-on: ubuntu-latest needs: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffe3d8032..a235435a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,26 +17,8 @@ defaults: shell: bash jobs: - build: - name: build - runs-on: ubuntu-latest - container: ghcr.io/${{ github.repository_owner }}/devkita64-atmosphere:latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Atmosphere - run: | - source /opt/venv/bin/activate - git config --global --add safe.directory "*" - make - - name: Remove debug - run: rm ./out/nintendo_nx_arm64_armv8a/release/atmosphere-*-debug.zip - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: atmosphere-artifacts - path: ./out/nintendo_nx_arm64_armv8a/release/* - + build-workflow: + uses: ./.github/workflows/build-jobs.yaml create-release: runs-on: ubuntu-latest needs: build