From 742f67a2ce953613e1ac1c5da526d12882047442 Mon Sep 17 00:00:00 2001 From: Akshat Patel Date: Wed, 25 Sep 2024 13:56:38 +0530 Subject: [PATCH] Add Github workflow and Readme. --- .github/workflows/README.md | 14 ++++++++++++++ .github/workflows/build.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/README.md create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000..4289d3f --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,14 @@ +## Running build.yml locally + +### Steps: + +1. Install [nektos/act](https://github.com/nektos/act) (Simplest way is to install using homebrew by: `brew install act`) +2. Install the `gh` command line tool (`brew install gh`) and authenticate it using `gh auth login`. +3. Make sure your github account has read access to the [cli-binary](https://github.com/PreternaturalAI/cli-binary) repo. +4. From the root directory `merge`, run the following command: + +``` +sudo act -P macos-latest=-self-hosted -W '.github/workflows/build.yml' -s GITHUB_TOKEN="$(gh auth token)" +``` + +**Note:** `sudo` is required here because an internal dependency ([`maxim-lobanov/setup-xcode@v1`](https://github.com/maxim-lobanov/setup-xcode/blob/7f352e61cbe8130c957c3bc898c4fb025784ea1e/src/xcode-selector.ts#L51)) uses the `sudo` command and causes `act` execution to wait for a password interactively. \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0676c5d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +name: Build Merge For All Platforms (Xcode 16 & Xcode 15.4) +on: + workflow_dispatch: +jobs: + build: + runs-on: macos-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + path: merge + - name: Cache derived data + if: ${{ !env.ACT }} # Skipping when run locally. + uses: actions/cache@v3 + with: + path: ~/Library/Developer/Xcode/DerivedData + key: ${{ runner.os }}-derived-data + restore-keys: | + ${{ runner.os }}-derived-data + - name: Run Preternatural Build (Xcode 16) + uses: PreternaturalAI/github-action@main + with: + command: build + derived_data_path: ~/Library/Developer/Xcode/DerivedData + xcode-version: '16' + build_all_platforms: 'true' + working-directory: 'merge' + - name: Run Preternatural Build (Xcode 15.4) + uses: PreternaturalAI/github-action@main + with: + command: build + derived_data_path: ~/Library/Developer/Xcode/DerivedData + xcode-version: '15.4' + build_all_platforms: 'true' + working-directory: 'merge' \ No newline at end of file