Skip to content

Commit

Permalink
fix: macos
Browse files Browse the repository at this point in the history
  • Loading branch information
Skylar Simoncelli committed Sep 30, 2024
1 parent e20d4d9 commit b7ae560
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
19 changes: 10 additions & 9 deletions .github/actions/artifacts/build-pc-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: "Build and Upload PC Artifacts"
description: "Build and upload partner-chains artifacts for Linux, macOS x86_64, and macOS arm64"
inputs:
sha:
description: "partner-chains commit SHA or branch to build from"
required: true
tag:
description: "partner-chains release tag to append to artifact name"
required: true
Expand All @@ -28,14 +25,10 @@ runs:
echo "PARTNER_CHAINS_NODE=partner-chains-node-${{ inputs.tag }}-aarch64-apple-darwin" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}

- name: Install protoc
shell: bash
run: |
cd $GITHUB_WORKSPACE
if [[ "${{ inputs.os }}" == "linux" ]]; then
sudo apt-get install -y protobuf-compiler
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then
Expand All @@ -49,37 +42,45 @@ runs:
fi
- name: Build partner-chains-node
shell: bash
run: |
cd $GITHUB_WORKSPACE
if [[ "${{ inputs.os }}" == "linux" ]]; then
rustup target add x86_64-unknown-linux-gnu
cargo build -p partner-chains-node --locked --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/partner-chains-node $PARTNER_CHAINS_NODE
chmod +x $PARTNER_CHAINS_NODE # Added chmod command
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then
rustup target add x86_64-apple-darwin
cargo build -p partner-chains-node --locked --release --target x86_64-apple-darwin
cp target/x86_64-apple-darwin/release/partner-chains-node $PARTNER_CHAINS_NODE
chmod +x $PARTNER_CHAINS_NODE # Added chmod command
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then
rustup target add aarch64-apple-darwin
cargo build -p partner-chains-node --locked --release --target aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/partner-chains-node $PARTNER_CHAINS_NODE
chmod +x $PARTNER_CHAINS_NODE # Added chmod command
fi
shell: bash
- name: Build partner-chains-cli
shell: bash
run: |
cd $GITHUB_WORKSPACE
if [[ "${{ inputs.os }}" == "linux" ]]; then
rustup target add x86_64-unknown-linux-gnu
cargo build -p partner-chains-cli --locked --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/partner-chains-cli $PARTNER_CHAINS_CLI
chmod +x $PARTNER_CHAINS_CLI # Added chmod command
elif [[ "${{ inputs.os }}" == "macos-x86_64" ]]; then
rustup target add x86_64-apple-darwin
cargo build -p partner-chains-cli --locked --release --target x86_64-apple-darwin
cp target/x86_64-apple-darwin/release/partner-chains-cli $PARTNER_CHAINS_CLI
chmod +x $PARTNER_CHAINS_CLI # Added chmod command
elif [[ "${{ inputs.os }}" == "macos-arm64" ]]; then
rustup target add aarch64-apple-darwin
cargo build -p partner-chains-cli --locked --release --target aarch64-apple-darwin
cp target/aarch64-apple-darwin/release/partner-chains-cli $PARTNER_CHAINS_CLI
chmod +x $PARTNER_CHAINS_CLI # Added chmod command
fi
- name: Upload partner-chains-cli artifact
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- name: Build and Upload for Linux
uses: ./.github/actions/artifacts/build-pc-artifacts
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}
os: linux

Expand All @@ -47,11 +46,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
ref: ${{ inputs.sha }}
- name: Build and Upload for macOS x86_64
uses: ./.github/actions/artifacts/build-pc-artifacts
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}
os: macos-x86_64

Expand All @@ -64,11 +62,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: master
ref: ${{ inputs.sha }}
- name: Build and Upload for macOS arm64
uses: ./.github/actions/artifacts/build-pc-artifacts
with:
sha: ${{ inputs.sha }}
tag: ${{ inputs.tag }}
os: macos-arm64

Expand Down

0 comments on commit b7ae560

Please sign in to comment.