This file contains hidden or 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: Release | ||
| on: | ||
| push: | ||
| branches: [master] | ||
| tags: ['v*'] | ||
| workflow_dispatch: | ||
| permissions: | ||
| contents: write | ||
| env: | ||
| ZIG_VERSION: 0.15.2 | ||
| jobs: | ||
| ci-gate: | ||
| name: CI Gate | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Wait for CI workflow | ||
| uses: lewagon/wait-on-check-action@v1.3.4 | ||
| with: | ||
| ref: ${{ github.sha }} | ||
| check-name: CI Status | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| wait-interval: 30 | ||
| running-workflow-name: CI Gate | ||
| build-linux-x86_64: | ||
| name: Build (Linux x86_64) | ||
| needs: ci-gate | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Install ZVM and Zig | ||
| run: | | ||
| curl -sSL https://www.zvm.app/install.sh | bash | ||
| export ZVM_INSTALL="$HOME/.zvm/self" | ||
| export PATH="$HOME/.zvm/bin:$ZVM_INSTALL:$PATH" | ||
| zvm i ${{ env.ZIG_VERSION }} | ||
| zvm use ${{ env.ZIG_VERSION }} | ||
| echo "$HOME/.zvm/bin" >> $GITHUB_PATH | ||
| echo "$HOME/.zvm/self" >> $GITHUB_PATH | ||
| - name: Install LLVM | ||
| run: | | ||
| # Install LLVM 22 using official apt.llvm.org repository | ||
| sudo apt-get update | ||
| sudo apt-get install -y lsb-release wget software-properties-common gnupg | ||
| # Add LLVM apt repository (modern method without deprecated apt-key) | ||
| wget -qO- https://apt.llvm.org/llvm.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg | ||
| echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-22 main" | sudo tee /etc/apt/sources.list.d/llvm.list | ||
| sudo apt-get update | ||
| sudo apt-get install -y llvm-22-dev clang-22 libclang-22-dev | ||
| echo "/usr/lib/llvm-22/bin" >> $GITHUB_PATH | ||
| - name: Build Release | ||
| run: zig build -Doptimize=ReleaseFast | ||
| - name: Package | ||
| run: | | ||
| mkdir -p dist | ||
| cp zig-out/bin/OmniScope dist/OmniScope-macos-aarch64 | ||
| chmod +x dist/OmniScope-macos-aarch64 | ||
| - name: Upload Artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: OmniScope-macos-aarch64 | ||
| path: dist/OmniScope-macos-aarch64 | ||
| retention-days: 1 | ||
| # build-macos-x86_64: | ||
| # name: Build (macOS x86_64) | ||
| # needs: ci-gate | ||
| # runs-on: macos-13 | ||
| # steps: | ||
| # - uses: actions/checkout@v4 | ||
| # | ||
| # - name: Install ZVM and Zig | ||
| # run: | | ||
| # curl -sSL https://www.zvm.app/install.sh | bash | ||
| # export ZVM_INSTALL="$HOME/.zvm/self" | ||
| # export PATH="$HOME/.zvm/bin:$ZVM_INSTALL:$PATH" | ||
| # zvm install ${{ env.ZIG_VERSION }} | ||
| # zvm use ${{ env.ZIG_VERSION }} | ||
| # echo "$HOME/.zvm/bin" >> $GITHUB_PATH | ||
| # echo "$HOME/.zvm/self" >> $GITHUB_PATH | ||
| # | ||
| # - name: Install LLVM | ||
| # run: brew install llvm@21 && echo "$(brew --prefix llvm@21)/bin" >> $GITHUB_PATH | ||
| # | ||
| # - name: Build Release | ||
| # run: make build | ||
| # | ||
| # - name: Package | ||
| # run: | | ||
| # mkdir -p dist | ||
| # cp zig-out/bin/OmniScope dist/OmniScope-macos-x86_64 | ||
| # chmod +x dist/OmniScope-macos-x86_64 | ||
| # | ||
| # - name: Upload Artifact | ||
| # uses: actions/upload-artifact@v4 | ||
| # with: | ||
| # name: OmniScope-macos-x86_64 | ||
| # path: dist/OmniScope-macos-x86_64 | ||
| # retention-days: 1 | ||
| release: | ||
| name: Create Release | ||
| needs: [build-linux-x86_64, build-macos-aarch64] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Read version | ||
| id: version | ||
| run: | | ||
| VERSION=$(cat VERSION) | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "tag=v$VERSION" >> $GITHUB_OUTPUT | ||
| - name: Read Release Notes | ||
| id: changelog | ||
| run: | | ||
| if [ -f RELEASE_NOTES.md ]; then | ||
| cp RELEASE_NOTES.md /tmp/release_body.md | ||
| echo "Using RELEASE_NOTES.md for release notes" | ||
| else | ||
| VERSION=$(cat VERSION) | ||
| CHANGELOG=$(awk " | ||
| /^## .*\[.*${VERSION}.*\]/ { found=1; next } | ||
| found && /^## .*\[/ { exit } | ||
| found { print } | ||
| " CHANGELOG.md) | ||
| if [ -z "$CHANGELOG" ]; then | ||
| CHANGELOG=$(cat CHANGELOG.md) | ||
| fi | ||
| echo "$CHANGELOG" > /tmp/release_body.md | ||
| echo "Falling back to CHANGELOG.md" | ||
| fi | ||
| - name: Download Linux x86_64 binary | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: OmniScope-linux-x86_64 | ||
| path: dist | ||
| - name: Download macOS aarch64 binary | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: OmniScope-macos-aarch64 | ||
| path: dist | ||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ steps.version.outputs.tag }} | ||
| name: OmniScope ${{ steps.version.outputs.tag }} | ||
| body_path: /tmp/release_body.md | ||
| draft: false | ||
| prerelease: false | ||
| files: | | ||
| dist/OmniScope-linux-x86_64 | ||
| dist/OmniScope-macos-aarch64 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||