From cb2c6225e928cf03ba9345e1a251614f28109740 Mon Sep 17 00:00:00 2001 From: EliSauder <24995216+EliSauder@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:21:53 -0800 Subject: [PATCH 1/5] ci: create pr-preview workflow --- .github/workflows/website-preview.yml | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/website-preview.yml diff --git a/.github/workflows/website-preview.yml b/.github/workflows/website-preview.yml new file mode 100644 index 000000000..323b6d425 --- /dev/null +++ b/.github/workflows/website-preview.yml @@ -0,0 +1,43 @@ +name: Deploy PR Preview Website + +permissions: + contents: read + +on: + pull_request: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Zig + uses: mlugg/setup-zig@v1 + with: + version: 0.13.0 + - name: Build Website + run: zig build + working-directory: website + - name: Publish Website Preview + uses: easingthemes/ssh-deploy@main + with: + SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }} + ARGS: "-vzrli" + SOURCE: website/zig-out + REMOTE_HOST: ${{ secrets.DEPLOY_HOST }} + REMOTE_USER: ${{ secrets.DEPLOY_USER }} + REMOTE_PORT: ${{ secrets.DEPLOY_PORT }} + TARGET: ${{ format('{0}/staging/pulls/{1}', secrets.DEPLOY_ROOT_DATA_PATH, github.event.number) }} + pr-comment: + runs-on: ubuntu-latest + needs: deploy + permissions: + pull-requests: write + steps: + - uses: mshick/add-pr-comment@v2 + with: + message: | + Heya! + You can check out a preview of your PR at [${{vars.WEBSITE_STAGING_HOST}}/pulls/${{ github.event.number}}](${{vars.WEBSITE_STAGING_HOST}}/pulls/${{ github.event.number}})! From 8da226145d84c69d835a53946454d8cc80e726fe Mon Sep 17 00:00:00 2001 From: EliSauder <24995216+EliSauder@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:33:53 -0800 Subject: [PATCH 2/5] ci(website-preview.yml): move to vars.TARGET_ZIG_VERSION --- .github/workflows/website-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/website-preview.yml b/.github/workflows/website-preview.yml index 323b6d425..a999986b0 100644 --- a/.github/workflows/website-preview.yml +++ b/.github/workflows/website-preview.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Zig uses: mlugg/setup-zig@v1 with: - version: 0.13.0 + version: ${{ vars.TARGET_ZIG_VERSION }} - name: Build Website run: zig build working-directory: website From 634bf30c70f9229a49a097abe8f3ff79b2c01965 Mon Sep 17 00:00:00 2001 From: EliSauder <24995216+EliSauder@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:33:10 -0800 Subject: [PATCH 3/5] ci(publish-github-pages.yml): move to vars.TARGET_ZIG_VERSION --- .github/workflows/publish-github-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-github-pages.yml b/.github/workflows/publish-github-pages.yml index a6f00f239..09e3d4fe9 100644 --- a/.github/workflows/publish-github-pages.yml +++ b/.github/workflows/publish-github-pages.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Zig uses: mlugg/setup-zig@v1 with: - version: 0.13.0 + version: ${{ vars.TARGET_ZIG_VERSION }} - name: Download and install GitHub CLI run: | From 8bd3b7474f3da64e723c81c93cf9d2f127aaa90e Mon Sep 17 00:00:00 2001 From: EliSauder <24995216+EliSauder@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:41:37 -0800 Subject: [PATCH 4/5] ci(ci.yml): move to vars.TARGET_ZIG_VERSION --- .github/workflows/ci.yml | 50 ++++++++++++++-------------------------- 1 file changed, 17 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ed1a658d..dfe8a1ef7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,9 +5,8 @@ on: pull_request: branches: [main, zig-master] - env: - ZIG_VERSION: ${{ github.ref == 'refs/heads/zig-master' && 'master' || '0.13.0' }} + ZIG_VERSION: ${{ github.ref == 'refs/heads/zig-master' && 'master' || vars.TARGET_ZIG_VERSION }} jobs: build: @@ -28,16 +27,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ - ubuntu-latest, - windows-latest, - macos-latest, - ] - port_dir: [ - gigadevice/gd32, - raspberrypi/rp2xxx, - stmicro/stm32, - ] + os: [ubuntu-latest, windows-latest, macos-latest] + port_dir: [gigadevice/gd32, raspberrypi/rp2xxx, stmicro/stm32] steps: - name: Checkout uses: actions/checkout@v4 @@ -53,11 +44,7 @@ jobs: name: Unit Test Regz strategy: matrix: - os: [ - ubuntu-latest, - windows-latest, - macos-latest, - ] + os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -74,11 +61,7 @@ jobs: name: Unit Test UF2 strategy: matrix: - os: [ - ubuntu-latest, - windows-latest, - macos-latest, - ] + os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -134,17 +117,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - example_dir: [ - espressif/esp, - gigadevice/gd32, - microchip/avr, - microchip/atsam, - nordic/nrf5x, - nxp/lpc, - stmicro/stm32, - raspberrypi/rp2xxx, - wch/ch32v, - ] + example_dir: + [ + espressif/esp, + gigadevice/gd32, + microchip/avr, + microchip/atsam, + nordic/nrf5x, + nxp/lpc, + stmicro/stm32, + raspberrypi/rp2xxx, + wch/ch32v, + ] steps: - name: Checkout uses: actions/checkout@v4 From af750d0f8ef224f535cbaec61f48b55ba453eb11 Mon Sep 17 00:00:00 2001 From: EliSauder <24995216+EliSauder@users.noreply.github.com> Date: Fri, 27 Dec 2024 19:41:46 -0800 Subject: [PATCH 5/5] ci(deploy.yml): move to vars.TARGET_ZIG_VERSION --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6e8c386c9..bb2847e5e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Zig uses: mlugg/setup-zig@v1 with: - version: 0.13.0 + version: ${{ vars.TARGET_ZIG_VERSION }} - name: Extract version run: echo "MICROZIG_VERSION=$(zig build package -- get-version)" >> $GITHUB_ENV