From d9056dba748d4327e8e04f8dd1893f2b4313387a Mon Sep 17 00:00:00 2001 From: Maxim Khvatalin Date: Thu, 14 Dec 2023 13:00:27 +0300 Subject: [PATCH 1/2] ci: automated builds --- .github/workflows/build.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..ea6142cf --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,26 @@ +name: build +on: + push: + branches: ["main"] + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository. + contents: write + steps: + - uses: actions/checkout@v3 + - name: "Bundle OCBundle" + working-directory: ./Sources/OCBundle + run: zip -qqrX ../../OCBundle.zip ./ + - name: "Bundle AIO" + working-directory: ./Sources/AIO + run: zip -qqrX ../../AIO.zip ./ + - name: "Bundle OC-Suite Configurator" + working-directory: ./Sources/OCBundle + run: zip -qqrX "../../OC-Suite Configurator.zip" "./switch/.packages/OC-Suite Configurator" ./switch/.overlays/ovlmenu.ovl + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "build: the recent bundle" + file_pattern: "*.zip" From f29d82e5d0b46b4cb12a74e4dfae227fdfdf559d Mon Sep 17 00:00:00 2001 From: Maxim Khvatalin Date: Thu, 14 Dec 2023 19:13:57 +0300 Subject: [PATCH 2/2] ci: make zip artifacts deterministic --- .github/workflows/build.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ea6142cf..852c3fc1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,6 +11,12 @@ jobs: contents: write steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # It's needed for git-restore-mtime + - name: Reset directories timestamp # Workaround for https://github.com/MestreLion/git-tools/issues/47 + run: find . -not -path '*/.*' -type d -exec touch -t 197001010000 {} \; + - name: Restore files timestamp + uses: chetan/git-restore-mtime-action@v2 # Restore files original modification time to have deterministic zip bundles - name: "Bundle OCBundle" working-directory: ./Sources/OCBundle run: zip -qqrX ../../OCBundle.zip ./