Skip to content

Commit

Permalink
[CI][MAC] Generate artifacts with and without codesigning (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamazeem authored Dec 20, 2024
1 parent 79e769b commit d3c3190
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,20 +283,20 @@ jobs:
{
echo "PREFIX=$PREFIX"
echo "ZIP=zsv-$TAG-$PREFIX.zip"
echo "TAR=zsv-$TAG-$PREFIX.tar.gz"
} | 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 }})
- name: Codesign and notarize (${{ env.ZIP }})
if: startsWith(github.ref, 'refs/tags/v')
env:
MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
Expand Down Expand Up @@ -324,6 +324,16 @@ jobs:
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
if-no-files-found: error

- name: Upload (${{ env.TAR }})
uses: actions/upload-artifact@v4
env:
ARTIFACT_NAME: ${{ env.TAR }}
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 release artifacts
if: startsWith(github.ref, 'refs/tags/v')
run: ./scripts/ci-upload-release-artifacts.sh
Expand Down
24 changes: 12 additions & 12 deletions scripts/ci-update-homebrew-tap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ if [ "$HOMEBREW_TAP_DEPLOY_KEY" = "" ] || [ "$TAG" = "" ]; then
exit 1
fi

AMD64_ZIP="zsv-$TAG-amd64-macosx-gcc.zip"
AMD64_URL="https://github.com/liquidaty/zsv/releases/download/v$TAG/$AMD64_ZIP"
ARM64_ZIP="zsv-$TAG-arm64-macosx-gcc.zip"
ARM64_URL="https://github.com/liquidaty/zsv/releases/download/v$TAG/$ARM64_ZIP"
AMD64_ARCHIVE="zsv-$TAG-amd64-macosx-gcc.tar.gz"
AMD64_URL="https://github.com/liquidaty/zsv/releases/download/v$TAG/$AMD64_ARCHIVE"
ARM64_ARCHIVE="zsv-$TAG-arm64-macosx-gcc.tar.gz"
ARM64_URL="https://github.com/liquidaty/zsv/releases/download/v$TAG/$ARM64_ARCHIVE"

HOMEBREW_TAP_REPO="git@github.com:liquidaty/homebrew-zsv.git"
HOMEBREW_TAP_DIR="homebrew-zsv"
Expand All @@ -24,22 +24,22 @@ echo "[INF] Updating homebrew tap"

echo "[INF] PWD: $PWD"
echo "[INF] TAG: $TAG"
echo "[INF] AMD64_ZIP: $AMD64_ZIP"
echo "[INF] AMD64_ARCHIVE: $AMD64_ARCHIVE"
echo "[INF] AMD64_URL: $AMD64_URL"
echo "[INF] ARM64_ZIP: $ARM64_ZIP"
echo "[INF] ARM64_ARCHIVE: $ARM64_ARCHIVE"
echo "[INF] ARM64_URL: $ARM64_URL"
echo "[INF] HOMEBREW_TAP_REPO: $HOMEBREW_TAP_REPO"
echo "[INF] HOMEBREW_TAP_DIR: $HOMEBREW_TAP_DIR"
echo "[INF] HOMEBREW_TAP_FORMULA: $HOMEBREW_TAP_FORMULA"

echo "[INF] Downloading release archives [$AMD64_ZIP, $ARM64_ZIP]"
echo "[INF] Downloading release archives [$AMD64_ARCHIVE, $ARM64_ARCHIVE]"
wget -q "$AMD64_URL" "$ARM64_URL"
ls -hl "$AMD64_ZIP" "$ARM64_ZIP"
ls -hl "$AMD64_ARCHIVE" "$ARM64_ARCHIVE"

echo "[INF] Calculating SHA256 hashes [$AMD64_ZIP, $ARM64_ZIP]"
AMD64_HASH=$(openssl dgst -sha256 "$AMD64_ZIP" | cut -d ' ' -f2 | tr -d '\n')
ARM64_HASH=$(openssl dgst -sha256 "$ARM64_ZIP" | cut -d ' ' -f2 | tr -d '\n')
rm -f "$AMD64_ZIP" "$ARM64_ZIP"
echo "[INF] Calculating SHA256 hashes [$AMD64_ARCHIVE, $ARM64_ARCHIVE]"
AMD64_HASH=$(openssl dgst -sha256 "$AMD64_ARCHIVE" | cut -d ' ' -f2 | tr -d '\n')
ARM64_HASH=$(openssl dgst -sha256 "$ARM64_ARCHIVE" | cut -d ' ' -f2 | tr -d '\n')
rm -f "$AMD64_ARCHIVE" "$ARM64_ARCHIVE"

echo "[INF] AMD64_HASH: $AMD64_HASH"
echo "[INF] ARM64_HASH: $ARM64_HASH"
Expand Down

0 comments on commit d3c3190

Please sign in to comment.