Skip to content

Build

Build #684

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
otp-ref-name:
required: true
otp-ref:
required: true
openssl-version:
default: "3.1.6"
wxwidgets-version:
default: "3.2.6"
jobs:
build_macos:
name: "Build ${{ inputs.otp-ref-name }}-${{ matrix.pair.target }} (${{ matrix.pair.os }})"
runs-on: ${{ matrix.pair.os }}
permissions:
actions: write
contents: write
id-token: write
attestations: write
env:
OPENSSL_VERSION: ${{ inputs.openssl-version }}
OPENSSL_DIR: /tmp/openssl-${{ matrix.pair.target }}
OTP_REF: ${{ inputs.otp-ref }}
OTP_REF_NAME: ${{ inputs.otp-ref-name }}
OTP_DIR: /tmp/otp-${{ matrix.pair.target }}
OTP_TGZ: /tmp/otp.tar.gz
WXWIDGETS_VERSION: ${{ inputs.wxwidgets-version }}
WXWIDGETS_DIR: /tmp/wxwidgets-${{ matrix.pair.target }}
strategy:
fail-fast: false
matrix:
include:
- pair:
os: macos-13
target: x86_64-apple-darwin
- pair:
os: macos-14
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Check OTP_REF_NAME
run: |
if [[ "$OTP_REF_NAME" =~ maint-([0-9]+) ]]; then
version="${BASH_REMATCH[1]}"
elif [[ "$OTP_REF_NAME" =~ OTP-([0-9]+)(\.[0-9]+)* ]]; then
version="${BASH_REMATCH[1]}"
else
version=25
fi
if [[ "$version" -lt 25 ]]; then
echo "skipping builds for OTP older than OTP-25"
echo "SKIP=true" >> "$GITHUB_ENV"
fi
- name: Update OPENSSL_VERSION
if: ${{ contains(env.OTP_REF_NAME, 'OTP-25') || contains(env.OTP_REF_NAME, 'maint-25') }}
run: echo "OPENSSL_VERSION=1.1.1w" >> "$GITHUB_ENV"
- uses: actions/cache@v4
if: ${{ env.SKIP != 'true' }}
with:
path: ${{ env.OPENSSL_DIR }}
key: openssl-${{ env.OPENSSL_VERSION }}-${{ matrix.pair.target }}
- uses: actions/cache@v4
if: ${{ env.SKIP != 'true' }}
with:
path: ${{ env.WXWIDGETS_DIR }}
key: wxwidgets-${{ env.WXWIDGETS_VERSION }}-${{ matrix.pair.target }}
# # Uncomment when testing
# - uses: actions/cache@v4
# id: otp-cache
# with:
# path: ${{ env.OTP_DIR }}
# key: "otp-${{ env.OTP_REF_NAME }}\
# -${{ env.OTP_REF }}\
# -openssl-${{ env.OPENSSL_VERSION }}\
# -wxwidgets-${{ env.WXWIDGETS_VERSION }}\
# -${{ matrix.pair.target }}"
- name: "Build OTP"
if: ${{ env.SKIP != 'true' }}
run: |
bash scripts/build_otp_macos.bash "${{ env.OTP_REF_NAME }}"
- name: "Attest build provenance"
if: ${{ env.SKIP != 'true' }}
uses: actions/attest-build-provenance@v1
id: attest-build-provenance
with:
subject-path: ${{ env.OTP_TGZ }}
- name: "Upload"
if: ${{ env.SKIP != 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ATTESTATION: ${{ steps.attest-build-provenance.outputs.bundle-path }}
WXWIDGETS_VERSION: ${{ inputs.wxwidgets-version }}
run: |
./scripts/upload.bash