Skip to content

Commit

Permalink
build: TOOLS-2933 use github actions to build m-series macos (#32)
Browse files Browse the repository at this point in the history
* build: add m1 build

* build: bump macos-11 runners to macos-12

---------

Co-authored-by: dwelch-spike <[email protected]>
  • Loading branch information
jdogmcsteezy and dwelch-spike authored Jul 30, 2024
1 parent 37f1280 commit a538109
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
git describe --tags --always
- uses: kenchan0130/actions-system-info@master
- uses: kenchan0130/actions-system-info@v1.3.0
id: system-info
- name: Download C Client Deps
run: |
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/mac-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ on:
repository_dispatch:
types: mac-build
push:
branches: [actionsHub, main, test-ready, "*-bugfix"]
branches: [actionsHub, main, "*-bugfix"]
pull_request:
branches: [main, test-ready]
branches: [main]
workflow_call:
inputs:
submodule:
Expand All @@ -16,7 +16,17 @@ on:

jobs:
build:
runs-on: macos-11
strategy:
matrix:
os: [macos-12, macos-14]
include:
- os: macos-12
openssl-path: /usr/local/opt/openssl
target-dir: target/Darwin-x86_64/bin
- os: macos-14
openssl-path: /opt/homebrew/opt/openssl
target-dir: target/Darwin-arm64/bin
runs-on: ${{ matrix.os }}
steps:
- name: Get checkout directory
uses: haya14busa/action-cond@v1
Expand Down Expand Up @@ -47,7 +57,7 @@ jobs:
run: |
git describe --tags --always
echo "tag=$(git describe --tags --always)" >> $GITHUB_OUTPUT
- uses: kenchan0130/actions-system-info@master
- uses: kenchan0130/actions-system-info@v1.3.0
id: system-info
- name: Cache Aql
uses: actions/cache@v3
Expand All @@ -61,7 +71,7 @@ jobs:
key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.release }}-build-${{ env.cache-name }}-${{ env.cache-index }}-${{ steps.tag.outputs.tag }}
- name: Download C Client Deps
run: |
brew install automake
brew install automake libtool
- name: Cache C Client
uses: actions/cache@v3
if: steps.cache-aql.outputs.cache-hit != 'true'
Expand All @@ -84,21 +94,17 @@ jobs:
if: steps.cache-aql.outputs.cache-hit != 'true'
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
make OPENSSL_STATIC_PATH=/usr/local/opt/openssl/lib
make OPENSSL_STATIC_PATH=${{ matrix.openssl-path }}/lib
- name: Sanity Test tools
working-directory: ${{ steps.working-dir.outputs.value }}
run: |
cd target/Darwin-x86_64/bin
ls target
cd ${{ matrix.target-dir }}
./aql -e "info" 2>&1 | grep "Failed to connect"
- name: Set Upload Arch
uses: haya14busa/action-cond@v1
id: upload-arch
with:
cond: ${{ runner.arch == 'X64' }}
if_true: x86_64
if_false: aarch64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.system-info.outputs.platform }}-${{ runner.arch }}-${{ runner.os }}-${{ steps.system-info.outputs.release }}-aql
path: ${{ steps.working-dir.outputs.value }}/target/Darwin-${{ steps.upload-arch.outputs.value }}/bin/aql
path: ${{ steps.working-dir.outputs.value }}/${{ matrix.target-dir }}/aql
if-no-files-found: error

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ $(JANSSON_PATH)/Makefile: $(JANSSON_PATH)/configure
cd $(JANSSON_PATH) && ./configure

$(JANSSON_PATH)/configure:
cd $(JANSSON_PATH) && autoreconf -i
cd $(JANSSON_PATH) && autoupdate && autoreconf -i

.INTERMEDIATE: $(JANSSON_PATH)/Makefile $(JANSSON_PATH)/configure

Expand Down

0 comments on commit a538109

Please sign in to comment.