From 110ff96452c0e3621e8c4c65290bb840e6d1848b Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:05:58 -0800 Subject: [PATCH 01/13] add canary --- .github/workflows/canary.yaml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/canary.yaml diff --git a/.github/workflows/canary.yaml b/.github/workflows/canary.yaml new file mode 100644 index 0000000..4b9375f --- /dev/null +++ b/.github/workflows/canary.yaml @@ -0,0 +1,49 @@ +name: Canary + +on: + push: + branches: + - main +env: + ZIG_VERSION: 0.13.0 + +permissions: + id-token: write + contents: write + attestations: write + +jobs: + build: + strategy: + matrix: + # FIXME: handle windows paths in attestation and upload steps + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: mlugg/setup-zig@v1 + with: + version: ${{ env.ZIG_VERSION }} + + - name: Get binary name + id: binary_name + run: echo "binary_name=zlint-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_OUTPUT" + + - name: zig build + env: + BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} + run: | + zig build --summary all --color on --release=safe -Dversion=${{ github.ref_name }} + mv zig-out/bin/zlint zig-out/bin/${{ env.BINARY_NAME }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-path: zig-out/bin/${{ steps.binary_name.outputs.binary_name }} + + - name: Upload zlint binary + uses: actions/upload-artifact@v4 + with: + path: zig-out/bin/zlint-${{ runner.os }}-${{ runner.arch }} + name: zlint-${{ runner.os }}-${{ runner.arch }} + retention-days: 1 From a68cd41a0b41354f2ee058c1bbacc9a62a07ddd2 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:08:40 -0800 Subject: [PATCH 02/13] wip --- .github/workflows/release.yaml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f31ab0f..b64f18c 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,10 +2,13 @@ name: Release on: push: - branches: - - main tags: - "v*.*.*" + + # for testing + pull_request: + branches: + - main env: ZIG_VERSION: 0.13.0 @@ -18,24 +21,23 @@ jobs: build: strategy: matrix: - # FIXME: handle windows paths in attestation and upload steps - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} + os: [linux, windows, macos] + arch: [aarch64, x86_64] + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: mlugg/setup-zig@v1 with: version: ${{ env.ZIG_VERSION }} - - name: Get binary name - id: binary_name - run: echo "binary_name=zlint-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_OUTPUT" - - name: zig build env: BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} run: | - zig build --summary all --color on --release=safe -Dversion=${{ github.ref_name }} + zig build --summary all --color on \ + --release=safe \ + -Dversion=${{ github.ref_name }} \ + -Dtarget=${{ matrix.arch }}-${{ matrix.os }} mv zig-out/bin/zlint zig-out/bin/${{ env.BINARY_NAME }} - name: Generate artifact attestation From a19b7c547179717f98d3a80a8573233ec92799b4 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:12:10 -0800 Subject: [PATCH 03/13] wip --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b64f18c..2ac585b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,8 @@ permissions: jobs: build: strategy: + # keep building others in case it's os-specific + fail-fast: false matrix: os: [linux, windows, macos] arch: [aarch64, x86_64] From 2074190636a2a7d2b5489f2d4f667e9a9d51affc Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:15:35 -0800 Subject: [PATCH 04/13] wip --- .github/workflows/release.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2ac585b..4eddf50 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,6 +26,8 @@ jobs: os: [linux, windows, macos] arch: [aarch64, x86_64] runs-on: ubuntu-latest + env: + BINARY_NAME: zlint-${{ matrix.os }}-${{ matrix.arch }} steps: - uses: actions/checkout@v4 - uses: mlugg/setup-zig@v1 @@ -45,13 +47,13 @@ jobs: - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: - subject-path: zig-out/bin/${{ steps.binary_name.outputs.binary_name }} + subject-path: zig-out/bin/${{ env.BINARY_NAME }} - name: Upload zlint binary uses: actions/upload-artifact@v4 with: - path: zig-out/bin/zlint-${{ runner.os }}-${{ runner.arch }} - name: zlint-${{ runner.os }}-${{ runner.arch }} + path: zig-out/bin/${{ env.BINARY_NAME}} + name: ${{ env.BINARY_NAME }} retention-days: 1 From 8ddf5e8bcc13880b30b345130df8430a3276c9d5 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:17:56 -0800 Subject: [PATCH 05/13] wip --- .github/workflows/release.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4eddf50..561cae7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,8 +35,6 @@ jobs: version: ${{ env.ZIG_VERSION }} - name: zig build - env: - BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} run: | zig build --summary all --color on \ --release=safe \ From 112b9d264bde00fcf5df2abe42c6941390b5ba60 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:24:23 -0800 Subject: [PATCH 06/13] wip --- .github/workflows/release.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 561cae7..ea7e081 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,6 +34,15 @@ jobs: with: version: ${{ env.ZIG_VERSION }} + - name: Get binary name + id: binary_name + run: | + binary_name=zlint-${{ runner.os }}-${{ runner.arch }} + if [[ "${{ matrix.os}}" == "windows" ]] ; then + binary_name="${binary_name}.exe" + fi + echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" + - name: zig build run: | zig build --summary all --color on \ From 7036cbf8c1585321cd2a1e181ac715e8d12c5975 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:27:16 -0800 Subject: [PATCH 07/13] wip binary name env var --- .github/workflows/release.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ea7e081..893ea57 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,8 +26,6 @@ jobs: os: [linux, windows, macos] arch: [aarch64, x86_64] runs-on: ubuntu-latest - env: - BINARY_NAME: zlint-${{ matrix.os }}-${{ matrix.arch }} steps: - uses: actions/checkout@v4 - uses: mlugg/setup-zig@v1 @@ -44,6 +42,8 @@ jobs: echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" - name: zig build + env: + BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} run: | zig build --summary all --color on \ --release=safe \ @@ -53,11 +53,15 @@ jobs: - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 + env: + BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} with: subject-path: zig-out/bin/${{ env.BINARY_NAME }} - name: Upload zlint binary uses: actions/upload-artifact@v4 + env: + BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} with: path: zig-out/bin/${{ env.BINARY_NAME}} name: ${{ env.BINARY_NAME }} From 375673b6178b22a4c728f7b7387e0654f1a393ca Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:29:41 -0800 Subject: [PATCH 08/13] wip --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 893ea57..ffde193 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,7 +35,7 @@ jobs: - name: Get binary name id: binary_name run: | - binary_name=zlint-${{ runner.os }}-${{ runner.arch }} + binary_name=zlint-${{ matrix.os }}-${{ os.arch }} if [[ "${{ matrix.os}}" == "windows" ]] ; then binary_name="${binary_name}.exe" fi From 64a1d9cfeeeec13851969bfc507433531e5dc91e Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:31:33 -0800 Subject: [PATCH 09/13] wip echo --- .github/workflows/release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ffde193..cbd1dc8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,6 +41,9 @@ jobs: fi echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" + - name: echo binary name + run: echo ${{ steps.binary_name.outputs.binary_name }} + - name: zig build env: BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} From b017665502cbeaf4dfb782b803b02ce186da7f9c Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:32:40 -0800 Subject: [PATCH 10/13] fix --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cbd1dc8..712bf72 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,8 +35,8 @@ jobs: - name: Get binary name id: binary_name run: | - binary_name=zlint-${{ matrix.os }}-${{ os.arch }} - if [[ "${{ matrix.os}}" == "windows" ]] ; then + binary_name=zlint-${{ matrix.os }}-${{ matrix.arch }} + if [[ "${{ matrix.os }}" == "windows" ]] ; then binary_name="${binary_name}.exe" fi echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" From da1afc0ad36f3c0e1fd1857359caf56596947c2a Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:35:20 -0800 Subject: [PATCH 11/13] love me some windows --- .github/workflows/release.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 712bf72..28ee9e6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -48,11 +48,15 @@ jobs: env: BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} run: | + binary_name=zlint + if [[ "${{ matrix.os }}" == "windows" ]] ; then + binary_name="${binary_name}.exe" + fi zig build --summary all --color on \ --release=safe \ -Dversion=${{ github.ref_name }} \ -Dtarget=${{ matrix.arch }}-${{ matrix.os }} - mv zig-out/bin/zlint zig-out/bin/${{ env.BINARY_NAME }} + mv zig-out/bin/${binary_name} zig-out/bin/${{ env.BINARY_NAME }} - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 From a09924d1638f3aff234db22f2e1ffad3939f0a1f Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:42:48 -0800 Subject: [PATCH 12/13] cleanup --- .github/workflows/canary.yaml | 49 ---------------------------------- .github/workflows/release.yaml | 12 +-------- 2 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 .github/workflows/canary.yaml diff --git a/.github/workflows/canary.yaml b/.github/workflows/canary.yaml deleted file mode 100644 index 4b9375f..0000000 --- a/.github/workflows/canary.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Canary - -on: - push: - branches: - - main -env: - ZIG_VERSION: 0.13.0 - -permissions: - id-token: write - contents: write - attestations: write - -jobs: - build: - strategy: - matrix: - # FIXME: handle windows paths in attestation and upload steps - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: mlugg/setup-zig@v1 - with: - version: ${{ env.ZIG_VERSION }} - - - name: Get binary name - id: binary_name - run: echo "binary_name=zlint-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_OUTPUT" - - - name: zig build - env: - BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} - run: | - zig build --summary all --color on --release=safe -Dversion=${{ github.ref_name }} - mv zig-out/bin/zlint zig-out/bin/${{ env.BINARY_NAME }} - - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-path: zig-out/bin/${{ steps.binary_name.outputs.binary_name }} - - - name: Upload zlint binary - uses: actions/upload-artifact@v4 - with: - path: zig-out/bin/zlint-${{ runner.os }}-${{ runner.arch }} - name: zlint-${{ runner.os }}-${{ runner.arch }} - retention-days: 1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 28ee9e6..c69c974 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,10 +5,6 @@ on: tags: - "v*.*.*" - # for testing - pull_request: - branches: - - main env: ZIG_VERSION: 0.13.0 @@ -41,9 +37,6 @@ jobs: fi echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" - - name: echo binary name - run: echo ${{ steps.binary_name.outputs.binary_name }} - - name: zig build env: BINARY_NAME: ${{ steps.binary_name.outputs.binary_name }} @@ -74,9 +67,8 @@ jobs: name: ${{ env.BINARY_NAME }} retention-days: 1 - -# TODO release: + # Not used. Leaving here in case we want to create canary builds if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest needs: @@ -90,8 +82,6 @@ jobs: pattern: zlint-* path: zig-out/dist merge-multiple: true - # TODO - - run: ls -lA zig-out/dist - name: Release uses: softprops/action-gh-release@v2 with: From f6819b31df06ca72f190024c24b17cc3509567c6 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Sat, 21 Dec 2024 00:45:57 -0800 Subject: [PATCH 13/13] format --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c69c974..9ed0735 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,7 +35,7 @@ jobs: if [[ "${{ matrix.os }}" == "windows" ]] ; then binary_name="${binary_name}.exe" fi - echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" + echo "binary_name=$binary_name" >> "$GITHUB_OUTPUT" - name: zig build env: