Merge pull request #8 from Certora/oz/release #71
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Tools | |
on: | |
push: | |
branches: | |
- main | |
tags: ['*'] | |
workflow_dispatch: | |
jobs: | |
build-mac-arm: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
brew install just ninja | |
rustup install 1.75 | |
rustup toolchain install 1.75 | |
rustup default 1.75-aarch64-apple-darwin | |
- name: Clone | |
run: just clone | |
- name: Prepare | |
run: just prepare | |
- name: Build rust, cargo and newlib | |
run: just build-all | |
- name: Package | |
env: | |
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }} | |
APPLE_CRED: ${{ secrets.APPLE_CRED }} | |
APPLE_P12_BASE64: ${{ secrets.APPLE_P12_BASE64 }} | |
APPLE_P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }} | |
APPLE_TEAMID: ${{ secrets.APPLE_TEAMID }} | |
APPLE_TEMPKEYCHAIN_PASSWORD: ${{ secrets.APPLE_TEMPKEYCHAIN_PASSWORD }} | |
run: just package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: platform-tools-osx-aarch64.tar.bz2 | |
path: out/platform-tools-osx-aarch64.tar.bz2 | |
build-mac-intel: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
brew install just ninja | |
rustup install 1.75 | |
rustup toolchain install 1.75 | |
rustup default 1.75-x86_64-apple-darwin | |
- name: Clone | |
run: just clone | |
- name: Prepare | |
run: just prepare | |
- name: Build rust, cargo and newlib | |
run: just build-all | |
- name: Package | |
env: | |
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }} | |
APPLE_CRED: ${{ secrets.APPLE_CRED }} | |
APPLE_P12_BASE64: ${{ secrets.APPLE_P12_BASE64 }} | |
APPLE_P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }} | |
APPLE_TEAMID: ${{ secrets.APPLE_TEAMID }} | |
APPLE_TEMPKEYCHAIN_PASSWORD: ${{ secrets.APPLE_TEMPKEYCHAIN_PASSWORD }} | |
run: just package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: platform-tools-osx-x86_64.tar.bz2 | |
path: out/platform-tools-osx-x86_64.tar.bz2 | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install just | |
uses: taiki-e/install-action@just | |
- name: Install dependencies | |
run: | | |
sudo apt update; sudo apt install ninja-build | |
rustup install 1.75 | |
rustup toolchain install 1.75 | |
rustup default 1.75-x86_64-unknown-linux-gnu | |
- name: Clone | |
run: just clone | |
- name: Prepare | |
run: just prepare | |
- name: Build rust, cargo and newlib | |
run: just build-all | |
- name: Package | |
run: just package | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: platform-tools-linux-x86_64.tar.bz2 | |
path: out/platform-tools-linux-x86_64.tar.bz2 | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: [build-linux, build-mac-arm, build-mac-intel] | |
if: startsWith(github.event.ref, 'refs/tags/') # only on new tag creation | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
- name: Create a release | |
env: | |
TAG: ${{ github.ref_name }} | |
GH_TOKEN: ${{ github.token }} | |
MACOS_ARM: platform-tools-osx-aarch64.tar.bz2 | |
MACOS_INTEL: platform-tools-osx-x86_64.tar.bz2 | |
LINUX: platform-tools-linux-x86_64.tar.bz2 | |
run: | | |
release_exist=$(gh release view $TAG 2>&1 || exit 0) | |
if [ "$release_exist" = "release not found" ]; then | |
gh release create $TAG $MACOS_ARM/$MACOS_ARM --title "Release $TAG" --generate-notes --latest | |
gh release upload $TAG $MACOS_INTEL/$MACOS_INTEL | |
gh release upload $TAG $LINUX/$LINUX | |
else | |
gh release upload $TAG $MACOS_ARM/$MACOS_ARM | |
gh release upload $TAG $MACOS_INTEL/$MACOS_INTEL | |
gh release upload $TAG $LINUX/$LINUX | |
fi |