diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..77a2036 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,22 @@ + +# Run command: `cirrus run --artifacts-dir receivers/electron/out` +task: + name: buildReceiverMac + macos_instance: + image: ghcr.io/cirruslabs/macos-ventura-xcode:14.3.1 + buildReceiverMac_script: + - source .secure_files/.env + - sudo security add-certificates -k /Library/Keychains/System.keychain ./.secure_files/developerID_application.cer + - security unlock-keychain -p "admin" ~/Library/Keychains/login.keychain + - security import ./.secure_files/Certificates.p12 -k ~/Library/Keychains/login.keychain -P "$FCAST_CERTIFICATES_PASSWORD" -T /usr/bin/codesign + # Keychain ignores access control, causing to prompt for access and failing in CI environments...: https://stackoverflow.com/a/40039594 + - "security set-key-partition-list -S apple-tool:,apple: -s -k admin ~/Library/Keychains/login.keychain" + + - cd receivers/electron + - npm install + - npm rebuild + - npm run build + - npm run make -- --platform="darwin" --arch="arm64" + - npm run make -- --platform="darwin" --arch="x64" + binary_artifacts: + path: receivers/electron/out/* diff --git a/.gitignore b/.gitignore index bbb35cd..72e3ac4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules/ .wrangler/ +.secure_files/ diff --git a/receivers/electron/.gitlab-ci.yml b/receivers/electron/.gitlab-ci.yml index aa60ca7..a486757 100644 --- a/receivers/electron/.gitlab-ci.yml +++ b/receivers/electron/.gitlab-ci.yml @@ -16,16 +16,31 @@ buildElectronDockerContainer: buildMac: stage: buildAndDeployElectron + image: ghcr.io/cirruslabs/macos-ventura-xcode@sha256:3380f24929d01a7ac48a554dd242340739387822cf1cb0d96be839ef91b89daf tags: - - m1-macos + - tart-installed before_script: + - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash + - sudo security add-certificates -k /Library/Keychains/System.keychain ./.secure_files/developerID_application.cer + - security unlock-keychain -p "admin" ~/Library/Keychains/login.keychain + - security import ./.secure_files/Certificates.p12 -k ~/Library/Keychains/login.keychain -P "$FCAST_CERTIFICATES_PASSWORD" -T /usr/bin/codesign + # Keychain ignores access control, causing to prompt for access and failing in CI environments...: https://stackoverflow.com/a/40039594 + - "security set-key-partition-list -S apple-tool:,apple: -s -k admin ~/Library/Keychains/login.keychain" + + - mkdir -p ~/.ssh/ + - cp ./.secure_files/id_ed25519 ~/.ssh/id_ed25519 + - cp ./.secure_files/id_ed25519.pub ~/.ssh/id_ed25519.pub + - chmod 700 ~/.ssh/ + - chmod 600 ~/.ssh/id_ed25519 + - chmod 600 ~/.ssh/id_ed25519.pub - cd receivers/electron script: - npm install + - npm rebuild - npm run build - npm run make -- --platform="darwin" --arch="arm64" - npm run make -- --platform="darwin" --arch="x64" - - scp -r out/make/* root@$FCAST_DO_RUNNER_IP:/artifacts/ + - scp -o StrictHostKeyChecking=no -r out/make/* root@$FCAST_DO_RUNNER_IP:/artifacts/ artifacts: untracked: false when: on_success