Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] MacOS codesignging + notarization #340

Merged
merged 49 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e458ca3
MacOS codesignging + notarization [skip ci]
iamazeem Dec 12, 2024
326dd6e
Update trigger
iamazeem Dec 12, 2024
a917cd6
Specify algorithm [skip ci]
iamazeem Dec 12, 2024
be3100a
Ignore this workflow in main CI
iamazeem Dec 12, 2024
28e10fc
Use main workflow instead (disable other jobs)
iamazeem Dec 12, 2024
88584a3
Use OpenSSL 1.1
iamazeem Dec 12, 2024
6eb9d9f
Try to import key and cert separately
iamazeem Dec 12, 2024
c874292
List key and crt file; fix password
iamazeem Dec 12, 2024
779ae27
Use `-passin` flag
iamazeem Dec 12, 2024
c95377e
Print OpenSSL version; use password directly
iamazeem Dec 12, 2024
24dba50
Run on both macos 13 and 14
iamazeem Dec 12, 2024
e4de9cb
Check if cert pwd is base64 encoded
iamazeem Dec 12, 2024
ac77184
Trim trailing newline
iamazeem Dec 12, 2024
3c4358e
Revert debugging changes
iamazeem Dec 12, 2024
f608221
Check with thirdparty action
iamazeem Dec 12, 2024
6effb55
Fix zsv path
iamazeem Dec 12, 2024
a98da2f
Fix copy
iamazeem Dec 12, 2024
ac185e9
Verfieid, got same error with thirdparty action; revert
iamazeem Dec 12, 2024
ff93f74
Add initial script [skip ci]
iamazeem Dec 12, 2024
d32cc70
Validate OS
iamazeem Dec 13, 2024
eb51138
Dump output JSON for notarization
iamazeem Dec 13, 2024
9aee50e
Build ZIP bundle
iamazeem Dec 13, 2024
e509931
Update paths
iamazeem Dec 13, 2024
e9e3915
Cleanup
iamazeem Dec 13, 2024
5b8a159
Validate notarization response
iamazeem Dec 13, 2024
df56cd1
Commit intermediate script updates [skip ci]
iamazeem Dec 13, 2024
6aa4b04
Remove entitlements stubs [skip ci]
iamazeem Dec 14, 2024
43a80a6
Fix prepare script for consecutive use [skip ci]
iamazeem Dec 14, 2024
792e1e3
Use updated script
iamazeem Dec 14, 2024
413dbe0
Fix test archive path
iamazeem Dec 14, 2024
a100991
Fix paths
iamazeem Dec 14, 2024
297bd6f
Fix naming issues
iamazeem Dec 14, 2024
a378da9
Keep original archive for testing
iamazeem Dec 14, 2024
1236767
Fix copying of final archive
iamazeem Dec 14, 2024
6f52633
Fix absolute paths
iamazeem Dec 14, 2024
45831e6
Add error handling for notarization
iamazeem Dec 14, 2024
97f7fcd
Enable all jobs + cleanup
iamazeem Dec 14, 2024
b369fa5
Fix jq installation; enable only macos jobs for verification
iamazeem Dec 14, 2024
d57010d
Use absolute ZIP path
iamazeem Dec 14, 2024
b77a451
Add robust file filtering for codesigning and ZIP creation
iamazeem Dec 14, 2024
acfa120
Store certificate in temporary directory
iamazeem Dec 14, 2024
d7a0346
Disable tests
iamazeem Dec 14, 2024
6bbaab5
Add error handling for codesigning
iamazeem Dec 14, 2024
05393ba
Update codesigning of individual files
iamazeem Dec 14, 2024
fcdf24c
Cleanup
iamazeem Dec 14, 2024
1cbaddc
Enable both macos runners
iamazeem Dec 14, 2024
63905fa
Enable all jobs
iamazeem Dec 14, 2024
37b155d
Codesign and notarize release builds only [skip ci]
iamazeem Dec 14, 2024
01cdb4a
Minor updates [skip ci]
iamazeem Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 65 additions & 81 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,9 @@ jobs:
- name: Run shellcheck
run: ./scripts/ci-run-shellcheck.sh

ci:
ci-linux:
needs: [tag, clang-format, cppcheck, shellcheck]

strategy:
matrix:
os: [ubuntu-22.04, macos-13, macos-14]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04
timeout-minutes: 15

env:
Expand All @@ -133,23 +128,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Linux
if: runner.os == 'Linux'
- name: Set up apt dependencies
run: |
sudo apt update
sudo apt install -y rpm alien tmux
sudo apt remove -y jq

- name: Set up macOS (AMD64 and ARM64)
if: runner.os == 'macOS'
run: |
brew install --quiet coreutils tree autoconf automake libtool tmux sqlite3
brew uninstall jq

# --- Build ---

- name: Build on Linux (${{ env.AMD64_LINUX_GCC }})
if: runner.os == 'Linux'
env:
PREFIX: ${{ env.AMD64_LINUX_GCC }}
CC: gcc
Expand All @@ -161,7 +146,6 @@ jobs:
./scripts/ci-create-rpm-package.sh

- name: Build on Linux (${{ env.AMD64_LINUX_CLANG }})
if: runner.os == 'Linux'
env:
PREFIX: ${{ env.AMD64_LINUX_CLANG }}
CC: clang
Expand All @@ -172,26 +156,6 @@ jobs:
./scripts/ci-create-debian-package.sh
./scripts/ci-create-rpm-package.sh

- name: Build on macOS (${{ env.AMD64_MACOSX_GCC }})
if: matrix.os == 'macos-13'
env:
PREFIX: ${{ env.AMD64_MACOSX_GCC }}
CC: gcc-13
MAKE: make
RUN_TESTS: true
run: ./scripts/ci-build.sh

- name: Build on macOS (${{ env.ARM64_MACOSX_GCC }})
if: matrix.os == 'macos-14'
env:
PREFIX: ${{ env.ARM64_MACOSX_GCC }}
CC: gcc-13
MAKE: make
RUN_TESTS: true
run: ./scripts/ci-build.sh

# --- Upload build artifacts ---

- name: Prepare build artifacts for upload
run: ./scripts/ci-prepare-artifacts-for-upload.sh

Expand All @@ -206,7 +170,6 @@ jobs:
run: ./scripts/ci-verify-attestations.sh

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.zip)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.zip
Expand All @@ -217,7 +180,6 @@ jobs:
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.zip)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.zip
Expand All @@ -228,7 +190,6 @@ jobs:
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.deb)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.deb
Expand All @@ -239,7 +200,6 @@ jobs:
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.deb)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.deb
Expand All @@ -250,7 +210,6 @@ jobs:
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.rpm)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.rpm
Expand All @@ -261,7 +220,6 @@ jobs:
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.rpm)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.rpm
Expand All @@ -271,30 +229,7 @@ jobs:
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.zip)
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.zip
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.zip)
if: matrix.os == 'macos-14'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.zip
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.tar.gz)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_GCC }}.tar.gz
Expand All @@ -305,7 +240,6 @@ jobs:
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.tar.gz)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_LINUX_CLANG }}.tar.gz
Expand All @@ -315,22 +249,72 @@ jobs:
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error

- name: Upload (zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.tar.gz)
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
- name: Upload release artifacts
if: startsWith(github.ref, 'refs/tags/v')
run: ./scripts/ci-upload-release-artifacts.sh

ci-macos:
needs: [tag, clang-format, cppcheck, shellcheck]

strategy:
matrix:
os: [macos-13, macos-14]

runs-on: ${{ matrix.os }}
timeout-minutes: 30

env:
TAG: ${{ needs.tag.outputs.TAG }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up homebrew dependencies
run: brew install --quiet coreutils tree autoconf automake libtool tmux sqlite3

- name: Set PREFIX and ZIP env var
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.AMD64_MACOSX_GCC }}.tar.gz
PREFIX: ${{ runner.arch == 'X64' && env.AMD64_MACOSX_GCC || env.ARM64_MACOSX_GCC }}
run: |
{
echo "PREFIX=$PREFIX"
echo "ZIP=zsv-$TAG-$PREFIX.zip"
} | tee -a "$GITHUB_ENV"

- name: Build on macOS (${{ env.AMD64_MACOSX_GCC }})
env:
CC: gcc-13
MAKE: make
RUN_TESTS: true
SKIP_TAR_ARCHIVE: true
run: ./scripts/ci-build.sh

- name: Prepare build artifacts for upload
run: ./scripts/ci-prepare-artifacts-for-upload.sh

- name: Codesign and notarize (${{ env.PREFIX }})
if: startsWith(github.ref, 'refs/tags/v')
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
MACOS_CERT_PASSWORD: ${{ secrets.MACOS_CERT_PASSWORD }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
run: ./scripts/ci-macos-codesign-and-notarize.sh "$PWD/$ARTIFACT_DIR/$ZIP"

- name: Attest build artifacts for release
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/attest-build-provenance@v2
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error
subject-path: ${{ env.ARTIFACT_DIR }}/*

- name: Verify attestations of release artifacts
if: startsWith(github.ref, 'refs/tags/v')
run: ./scripts/ci-verify-attestations.sh

- name: Upload (zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.tar.gz)
if: matrix.os == 'macos-14'
- name: Upload (${{ env.ZIP }})
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: zsv-${{ env.TAG }}-${{ env.ARM64_MACOSX_GCC }}.tar.gz
ARTIFACT_NAME: ${{ env.ZIP }}
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_DIR }}/${{ env.ARTIFACT_NAME }}
Expand Down Expand Up @@ -710,7 +694,7 @@ jobs:
with:
path: playground

deploy-playground:
deploy-wasm-playground:
if: ${{ github.ref_name == 'main' }}
needs: ci-wasm
runs-on: ubuntu-22.04
Expand Down
Loading