fix(build): create profile dir before fingerprint write #10
Workflow file for this run
This file contains hidden or 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
| --- | |
| name: Native macOS Artifact | |
| 'on': | |
| push: | |
| tags: | |
| - 'macos-v*' | |
| workflow_dispatch: | |
| inputs: | |
| git_ref: | |
| description: "Git ref to build (branch, tag, or SHA)" | |
| required: false | |
| default: "" | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: native-macos-artifact-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-macos-artifact: | |
| name: Build macOS artifact | |
| runs-on: macos-15 | |
| env: | |
| STAGE_DIR: /tmp/ecc-macos | |
| DERIVED_DATA_PATH: /tmp/ecc-macos/DerivedData | |
| APP_BUNDLE_NAME: EveryCodeCompanion.app | |
| SCHEME: CodeNativeMac | |
| XCODE_PROJECT: native/CodeNativeMac/CodeNativeMac.xcodeproj | |
| steps: | |
| - name: Resolve checkout ref | |
| id: resolve_ref | |
| run: | | |
| set -euo pipefail | |
| ref="$GITHUB_REF" | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] \ | |
| && [ -n "${{ github.event.inputs.git_ref }}" ]; then | |
| ref="${{ github.event.inputs.git_ref }}" | |
| fi | |
| echo "value=$ref" >> "$GITHUB_OUTPUT" | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ steps.resolve_ref.outputs.value }} | |
| - name: Build managed backend | |
| run: | | |
| set -euo pipefail | |
| ./build-fast.sh | |
| - name: Build release app | |
| run: | | |
| set -euo pipefail | |
| xcodebuild \ | |
| -project "$XCODE_PROJECT" \ | |
| -scheme "$SCHEME" \ | |
| -configuration Release \ | |
| -destination "generic/platform=macOS" \ | |
| -derivedDataPath "$DERIVED_DATA_PATH" \ | |
| CODE_SIGNING_ALLOWED=NO \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| build | |
| - name: Package artifact | |
| run: | | |
| set -euo pipefail | |
| mkdir -p "$STAGE_DIR" | |
| app_source="$DERIVED_DATA_PATH/Build/Products/Release/$APP_BUNDLE_NAME" | |
| if [ ! -d "$app_source" ]; then | |
| echo "missing app bundle at $app_source" >&2 | |
| exit 1 | |
| fi | |
| cp -R "$app_source" "$STAGE_DIR/$APP_BUNDLE_NAME" | |
| arch="$(uname -m)" | |
| archive="$STAGE_DIR/EveryCodeCompanion-macos-${arch}.zip" | |
| ditto -c -k --sequesterRsrc --keepParent \ | |
| "$STAGE_DIR/$APP_BUNDLE_NAME" \ | |
| "$archive" | |
| shasum -a 256 "$archive" > "$archive.sha256" | |
| echo "archive=$archive" >> "$GITHUB_OUTPUT" | |
| id: package | |
| - name: Upload macOS artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: EveryCodeCompanion-macos | |
| path: | | |
| ${{ steps.package.outputs.archive }} | |
| ${{ steps.package.outputs.archive }}.sha256 | |
| if-no-files-found: error | |
| - name: Resolve release tag | |
| id: release_tag | |
| run: | | |
| set -euo pipefail | |
| candidate="${{ steps.resolve_ref.outputs.value }}" | |
| case "$candidate" in | |
| refs/tags/*) | |
| candidate="${candidate#refs/tags/}" | |
| ;; | |
| esac | |
| if [[ "$candidate" =~ ^macos-v.+$ ]]; then | |
| echo "value=$candidate" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish GitHub release assets | |
| if: steps.release_tag.outputs.value != '' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ steps.release_tag.outputs.value }} | |
| name: EveryCodeCompanion ${{ steps.release_tag.outputs.value }} | |
| files: | | |
| ${{ steps.package.outputs.archive }} | |
| ${{ steps.package.outputs.archive }}.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |