test codesign

This commit is contained in:
neil 2023-02-02 13:12:27 +08:00
parent 5eb7262231
commit 1c64e8dd31
2 changed files with 72 additions and 61 deletions

View file

@ -104,6 +104,7 @@ jobs:
platform: platform:
- os: macos-11 - os: macos-11
name: darwin+x86-64 name: darwin+x86-64
# TODO: #181 build for linux
# - os: ubuntu-latest # - os: ubuntu-latest
# name: linux+x86-64 # name: linux+x86-64
- os: [self-hosted, macOS, ARM64] - os: [self-hosted, macOS, ARM64]
@ -137,60 +138,10 @@ jobs:
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }} # APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} # APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
run: tea -ES xc build run: tea -ES xc build
build_tauri: - run: mkdir -p target
needs: changes - run: cp ./modules/desktop/dist/tea-0.0.0-arm64.dmg ./target
if: false - run: cp ./modules/desktop/dist/tea-0.0.0-arm64.zip ./target
runs-on: ${{ matrix.platform.os }} - run: tar -czvf artifacts.tgz -C ./target/ .
strategy:
matrix:
platform:
- os: macos-11
name: darwin+x86-64
- os: ubuntu-latest
name: linux+x86-64
- os: [self-hosted, macOS, ARM64]
name: darwin+aarch64
# err: Package atk was not found in the pkg-config search path.
# requires atk >= 2.18
# - os: [self-hosted, linux, ARM64]
# name: linux+aarch64
steps:
- uses: actions/checkout@v3
- uses: teaxyz/setup@v0
if: startsWith(matrix.platform.name, 'darwin')
- name: cache gui build
# TODO: cache issue in our self-hosted macos runner ESPIPE: invalid seek, read
# but its ok to ignore, its still the fastest builder
# NOTE: enabling cache in the self hosted runner slows down the pipeline by 4m because post-cache builder error ^
if: startsWith(matrix.platform.name, 'linux') || matrix.platform.name == 'darwin+x86-64'
uses: actions/cache@v3
with:
key: ${{matrix.platform.name}}-pnpm-cargo
path: |
./pnpm
./target
# - name: build tauri for Linux
# uses: ./devops/linux-build
- name: build tauri for MacOS
if: startsWith(matrix.platform.name, 'darwin')
# FROM: https://tauri.app/v1/guides/distribution/sign-macos
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
run: tea -ES xc build
- name: build tauri for Linux
if: startsWith(matrix.platform.name, 'linux')
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
uses: ./devops/linux-builder
- run: tar -czvf artifacts.tgz -C ./target/release/bundle .
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -213,24 +164,84 @@ jobs:
- run: tar xzf artifacts.tgz - run: tar xzf artifacts.tgz
- run: cd ./macos/ && zip -r tea.zip tea.app
# Notarize. Can take up to 10 minutes (and fail) asynchronously # Notarize. Can take up to 10 minutes (and fail) asynchronously
- run: xcrun altool --notarize-app --username "$APPLE_ID" --password "$APPLE_PASSWORD" --primary-bundle-id "com.tea.xyz" --file ./macos/tea.zip - run: xcrun altool --notarize-app --username "$APPLE_ID" --password "$APPLE_PASSWORD" --primary-bundle-id "xyz.tea.gui" --file ./tea.zip
env: env:
APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# build_tauri:
# needs: changes
# if: false
# runs-on: ${{ matrix.platform.os }}
# strategy:
# matrix:
# platform:
# - os: macos-11
# name: darwin+x86-64
# - os: ubuntu-latest
# name: linux+x86-64
# - os: [self-hosted, macOS, ARM64]
# name: darwin+aarch64
# # err: Package atk was not found in the pkg-config search path.
# # requires atk >= 2.18
# # - os: [self-hosted, linux, ARM64]
# # name: linux+aarch64
# steps:
# - uses: actions/checkout@v3
# - uses: teaxyz/setup@v0
# if: startsWith(matrix.platform.name, 'darwin')
# - name: cache gui build
# # TODO: cache issue in our self-hosted macos runner ESPIPE: invalid seek, read
# # but its ok to ignore, its still the fastest builder
# # NOTE: enabling cache in the self hosted runner slows down the pipeline by 4m because post-cache builder error ^
# if: startsWith(matrix.platform.name, 'linux') || matrix.platform.name == 'darwin+x86-64'
# uses: actions/cache@v3
# with:
# key: ${{matrix.platform.name}}-pnpm-cargo
# path: |
# ./pnpm
# ./target
# # - name: build tauri for Linux
# # uses: ./devops/linux-build
# - name: build tauri for MacOS
# if: startsWith(matrix.platform.name, 'darwin')
# # FROM: https://tauri.app/v1/guides/distribution/sign-macos
# env:
# CARGO_TARGET_DIR: ${{ github.workspace }}/target
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
# run: tea -ES xc build
# - name: build tauri for Linux
# if: startsWith(matrix.platform.name, 'linux')
# # TODO: https://tauri.app/v1/guides/distribution/sign-linux
# uses: ./devops/linux-builder
# - run: tar -czvf artifacts.tgz -C ./target/release/bundle .
# - name: upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: ${{ matrix.platform.name }}
# path: artifacts.tgz
# if-no-files-found: error
upload: upload:
needs: [build_tauri, notorize_tauri] needs: [notorize_tauri]
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
platform: platform:
- name: darwin+x86-64 - name: darwin+x86-64
id: mac_latest id: mac_latest
- name: linux+x86-64 # - name: linux+x86-64
id: linux # id: linux
- name: darwin+aarch64 - name: darwin+aarch64
id: mac_m1 id: mac_m1
# - name: linux+aarch64 # - name: linux+aarch64

View file

@ -1,6 +1,6 @@
{ {
"appId": "xyz.tea.gui", "appId": "xyz.tea.gui",
"productName": "gui", "productName": "tea",
"asar": true, "asar": true,
"directories": { "output": "dist" }, "directories": { "output": "dist" },
"files": ["src/electron.cjs", { "from": "build", "to": "" }] "files": ["src/electron.cjs", { "from": "build", "to": "" }]