From d35208bf17553d309cf80998384a0b6e00fa136e Mon Sep 17 00:00:00 2001 From: Jamil Date: Thu, 29 Jun 2023 13:16:29 -0700 Subject: [PATCH] Stub out client app directories in monorepo structure (#1716) Stubs out the client app dirs and basic CI workflow for the client apps in preparation to move them into this repository. After this is merged @roop @pratikvelani you should be able to add the client repos here. --- .github/CODEOWNERS | 4 ++- .github/dependabot.yml | 9 +++++ .github/workflows/kotlin.yml | 66 ++++++++++++++++++++++++++++++++++++ .github/workflows/swift.yml | 42 +++++++++++++++++++++++ kotlin/README.md | 24 +++++++++++++ swift/README.md | 25 ++++++++++++++ 6 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/kotlin.yml create mode 100644 .github/workflows/swift.yml create mode 100644 kotlin/README.md create mode 100644 swift/README.md diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4c613c255..dc20e506b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,7 @@ .github/ @AndrewDryga @jamilbk elixir/ @AndrewDryga terraform/ @AndrewDryga -www/ @jamilbk +website/ @jamilbk rust/ @conectado +swift/ @roop @francesca64 +kotlin/ @pratikvelani @francesca64 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 342ee748d..4b94a5ac4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -25,3 +25,12 @@ updates: directory: "rust/" schedule: interval: "weekly" + - package-ecosystem: "maven" + directory: "rust/connlib/clients/android" + schedule: + interval: "weekly" + - package-ecosystem: "maven" + directory: "kotlin/" + schedule: + interval: "weekly" + # TODO: Apple package ecosystem diff --git a/.github/workflows/kotlin.yml b/.github/workflows/kotlin.yml new file mode 100644 index 000000000..a93e5a478 --- /dev/null +++ b/.github/workflows/kotlin.yml @@ -0,0 +1,66 @@ +name: Kotlin +on: + pull_request: + paths: + - "kotlin/**" + - ".github/workflows/kotlin.yml" + merge_group: + types: [checks_requested] + workflow_call: + +# Cancel old workflow runs if new code is pushed +concurrency: + group: "kotlin-${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + draft-release: + runs-on: ubuntu-latest + outputs: + tag_name: ${{ steps.release_drafter.outputs.tag_name }} + steps: + - uses: release-drafter/release-drafter@v5 + with: + commitish: cloud + id: release_drafter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # TODO: Add a basic CI for the Android client + # See rust.yml how we build, package and release connlib as an example + build: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./kotlin + needs: + - draft-release + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'adopt' + # TODO: Is this relevant for the Android client? + # - name: Validate Gradle wrapper + # uses: gradle/wrapper-validation-action@v1 + # - uses: actions/cache@v3 + # with: + # path: | + # ~/.gradle/caches + # ~/.gradle/wrapper + # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + # restore-keys: | + # ${{ runner.os }}-gradle- + # - name: Assemble Release + # uses: gradle/gradle-build-action@v2 + # with: + # arguments: build assembleRelease + # - name: Move artifact + # run: | + # mv ./rust/connlib/clients/android/lib/build/outputs/aar/lib-release.aar ./connlib-${{ needs.draft-release.outputs.tag_name }}.aar + # - uses: actions/upload-artifact@v3 + # with: + # name: connlib-android + # path: | + # ./connlib-${{ needs.draft-release.outputs.tag_name }}.aar diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 000000000..5f548db5e --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,42 @@ +name: Swift +on: + pull_request: + paths: + - "swift/**" + - ".github/workflows/swift.yml" + merge_group: + types: [checks_requested] + workflow_call: + +# Cancel old workflow runs if new code is pushed +concurrency: + group: "swift-${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + draft-release: + runs-on: ubuntu-latest + outputs: + tag_name: ${{ steps.release_drafter.outputs.tag_name }} + steps: + - uses: release-drafter/release-drafter@v5 + with: + commitish: cloud + id: release_drafter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # TODO: Add a basic CI for the Apple client + # See rust.yml how we build, package and release connlib as an example + build: + runs-on: macos-latest + permissions: + contents: read + defaults: + run: + working-directory: ./swift + needs: + - draft-release + steps: + - uses: actions/checkout@v3 + # TODO: Build Apple client from the CLI diff --git a/kotlin/README.md b/kotlin/README.md new file mode 100644 index 000000000..c46720073 --- /dev/null +++ b/kotlin/README.md @@ -0,0 +1,24 @@ +# Firezone Android client + +## Prerequisites for developing locally + +1. Install a recent `ruby` for your platform. Ruby is used for the mock auth + server. +1. Install needed gems and start mock auth server: + +``` +cd server +bundle install +ruby server.rb +``` + +1. Add the following to a `./local.properties` file: + +```gradle +sdk.dir=/path/to/your/ANDROID_HOME +``` + +Replace `/path/to/your/ANDROID_HOME` with the path to your locally installed +Android SDK. On macOS this is `/Users/jamil/Library./Android/sdk` + +1. Perform a test build: `./gradlew build` diff --git a/swift/README.md b/swift/README.md new file mode 100644 index 000000000..40a397727 --- /dev/null +++ b/swift/README.md @@ -0,0 +1,25 @@ +# Firezone Apple Client + +Firezone app clients for macOS and iOS. + +## Builidng + +Clone this repo: + +```bash +git clone https://github.com/firezone/firezone +cd swift +``` + +Rename and populate developer team ID file: + +```bash +cp Firezone/Developer.xcconfig.template Firezone/Developer.xcconfig +vim Firezone/Developer.xcconfig +``` + +Open project in Xcode: + +```bash +open Firezone.xcodeproj +```