Build mac demo #6
Workflow file for this run
This file contains 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
on: | |
workflow_dispatch: | |
inputs: | |
architecture: | |
description: "Architecture" | |
required: true | |
default: "intel" | |
type: choice | |
options: | |
- intel | |
- arm | |
includeDemoData: | |
description: "Include demo data" | |
required: true | |
default: "false" | |
type: choice | |
options: | |
- false | |
- true | |
name: Build mac demo | |
jobs: | |
build_and_test: | |
name: Build mac demo | |
runs-on: self-hosted | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: ./build/mac/build.sh ${{ inputs.architecture }} ${{ inputs.includeDemoData }} | |
# Upload artifact would remove +x (execute) permission and attributes from files when zipping | |
# thus need to manually zip (unfortunately it would be double zipped) | |
- name: Get Name and Zip | |
run: | | |
ARTIFACT_NAME=$(./build/mac/get_name.sh ${{ inputs.architecture }}) | |
ZIPPED_ARTIFACT_NAME="${ARTIFACT_NAME}.zip" | |
# https://developer.apple.com/forums/thread/690457 (keep attributes) | |
ditto -c -k --keepParent --sequesterRsrc "${ARTIFACT_NAME}/" $ZIPPED_ARTIFACT_NAME | |
# Below would add it env.artifactName and env.zippedArtifactName, so it can be used in upload-artifact action | |
echo "artifactName=${ARTIFACT_NAME}" >> $GITHUB_ENV | |
echo "zippedArtifactName=${ZIPPED_ARTIFACT_NAME}" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.artifactName }} | |
path: ${{ env.zippedArtifactName }} |