Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
318 changes: 181 additions & 137 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,94 +13,181 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: write

jobs:
build-linux-x86_64:
env:
ARCH: x86_64
OS: linux

runs-on: ubuntu-22.04
timeout-minutes: 15

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# fetch submodules recusively, to get zig-js-runtime submodules also.
submodules: recursive

- uses: ./.github/actions/install
with:
os: ${{env.OS}}
arch: ${{env.ARCH}}

- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: upload on s3
run: |
export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: Upload the build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
tag: nightly

build-linux-aarch64:
# build-linux-x86_64:
# env:
# ARCH: x86_64
# OS: linux

# runs-on: ubuntu-22.04
# timeout-minutes: 15

# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# # fetch submodules recusively, to get zig-js-runtime submodules also.
# submodules: recursive

# - uses: ./.github/actions/install
# with:
# os: ${{env.OS}}
# arch: ${{env.ARCH}}

# - name: zig build
# run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

# - name: Rename binary
# run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: upload on s3
# run: |
# export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
# aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: Upload the build
# uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
# tag: nightly

# build-linux-aarch64:
# env:
# ARCH: aarch64
# OS: linux

# runs-on: ubuntu-22.04-arm
# timeout-minutes: 15

# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# # fetch submodules recusively, to get zig-js-runtime submodules also.
# submodules: recursive

# - uses: ./.github/actions/install
# with:
# os: ${{env.OS}}
# arch: ${{env.ARCH}}

# - name: zig build
# run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=generic -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

# - name: Rename binary
# run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: upload on s3
# run: |
# export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
# aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: Upload the build
# uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
# tag: nightly

# build-macos-aarch64:
# env:
# ARCH: aarch64
# OS: macos

# # macos-14 runs on arm CPU. see
# # https://github.com/actions/runner-images?tab=readme-ov-file
# runs-on: macos-14
# timeout-minutes: 15

# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# # fetch submodules recusively, to get zig-js-runtime submodules also.
# submodules: recursive

# - uses: ./.github/actions/install
# with:
# os: ${{env.OS}}
# arch: ${{env.ARCH}}

# - name: zig build
# run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

# - name: Rename binary
# run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: upload on s3
# run: |
# export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
# aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: Upload the build
# uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
# tag: nightly

# build-macos-x86_64:
# env:
# ARCH: x86_64
# OS: macos

# # macos-13 runs on x86 CPU. see
# # https://github.com/actions/runner-images?tab=readme-ov-file
# # If we want to build for macos-14 or superior, we need to switch to
# # macos-14-large.
# # No need for now, but maybe we will need it in the short term.
# runs-on: macos-13
# timeout-minutes: 15

# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# # fetch submodules recusively, to get zig-js-runtime submodules also.
# submodules: recursive

# - uses: ./.github/actions/install
# with:
# os: ${{env.OS}}
# arch: ${{env.ARCH}}

# - name: zig build
# run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

# - name: Rename binary
# run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: upload on s3
# run: |
# export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
# aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

# - name: Upload the build
# uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
# tag: nightly

build-aarch64-ios:
env:
OS: ios
ARCH: aarch64
OS: linux

runs-on: ubuntu-22.04-arm
timeout-minutes: 15

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# fetch submodules recusively, to get zig-js-runtime submodules also.
submodules: recursive

- uses: ./.github/actions/install
with:
os: ${{env.OS}}
arch: ${{env.ARCH}}
TARGET_ENVIRONMENT: simulator

- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=generic -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: upload on s3
run: |
export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: Upload the build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
tag: nightly

build-macos-aarch64:
env:
ARCH: aarch64
OS: macos

# macos-14 runs on arm CPU. see
# macos-15 runs on arm CPU. see
# https://github.com/actions/runner-images?tab=readme-ov-file
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 15

steps:
Expand All @@ -116,62 +203,19 @@ jobs:
arch: ${{env.ARCH}}

- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }}) static-build

- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: upload on s3
run: |
export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: Upload the build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
tag: nightly

build-macos-x86_64:
env:
ARCH: x86_64
OS: macos

# macos-13 runs on x86 CPU. see
# https://github.com/actions/runner-images?tab=readme-ov-file
# If we want to build for macos-14 or superior, we need to switch to
# macos-14-large.
# No need for now, but maybe we will need it in the short term.
runs-on: macos-13
timeout-minutes: 15

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# fetch submodules recusively, to get zig-js-runtime submodules also.
submodules: recursive

- uses: ./.github/actions/install
with:
os: ${{env.OS}}
arch: ${{env.ARCH}}

- name: zig build
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})

- name: Rename binary
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: upload on s3
run: |
export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
aws s3 cp --storage-class=GLACIER_IR lightpanda-${{ env.ARCH }}-${{ env.OS }} s3://lpd-nightly-build/${DIR}/lightpanda-${{ env.ARCH }}-${{ env.OS }}

- name: Upload the build
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
tag: nightly
run: mv zig-out/lib/liblightpanda.a liblightpanda-${{ env.ARCH }}-${{ env.OS }}.a

# - name: upload on s3
# run: |
# export DIR=`git show --no-patch --no-notes --pretty='%cs_%h'`
# aws s3 cp --storage-class=GLACIER_IR liblightpanda-${{ env.ARCH }}-${{ env.OS }}.a s3://lpd-nightly-build/${DIR}/liblightpanda-${{ env.ARCH }}-${{ env.OS }}.a

# - name: Upload the build
# uses: ncipollo/release-action@v1
# with:
# allowUpdates: true
# artifacts: lightpanda-${{ env.ARCH }}-${{ env.OS }}
# tag: nightly
Loading
Loading