2023-05-10 07:03:22 +03:00
|
|
|
name: Build Canary Desktop App on Staging Branch
|
|
|
|
|
|
|
|
on:
|
2023-09-08 02:51:20 +03:00
|
|
|
workflow_dispatch:
|
2023-10-17 04:15:19 +03:00
|
|
|
inputs:
|
|
|
|
channel_override:
|
|
|
|
description: 'channel type (canary, beta, or stable)'
|
|
|
|
type: choice
|
|
|
|
default: beta
|
|
|
|
options:
|
|
|
|
- canary
|
|
|
|
- beta
|
|
|
|
- stable
|
2023-05-10 07:03:22 +03:00
|
|
|
push:
|
|
|
|
branches:
|
2023-06-14 19:43:28 +03:00
|
|
|
# 0.6.x-staging
|
2023-05-10 07:03:22 +03:00
|
|
|
- v[0-9]+.[0-9]+.x-staging
|
2023-06-14 19:43:28 +03:00
|
|
|
# 0.6.1-staging
|
|
|
|
- v[0-9]+.[0-9]+.[0-9]+-staging
|
2023-05-10 07:03:22 +03:00
|
|
|
paths-ignore:
|
|
|
|
- README.md
|
|
|
|
- .github/**
|
|
|
|
- '!.github/workflows/nightly-build.yml'
|
2023-06-30 11:47:07 +03:00
|
|
|
- '!.github/actions/build-rust/action.yml'
|
2023-06-17 12:49:07 +03:00
|
|
|
- '!.github/actions/setup-node/action.yml'
|
2023-05-10 07:03:22 +03:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
actions: write
|
|
|
|
contents: write
|
|
|
|
security-events: write
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
# The concurrency group contains the workflow name and the branch name for
|
|
|
|
# pull requests or the commit hash for any other events.
|
|
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
env:
|
2023-10-17 04:15:19 +03:00
|
|
|
# BUILD_TYPE => app icon, app name, etc
|
2023-05-11 05:42:56 +03:00
|
|
|
BUILD_TYPE: internal
|
2023-10-17 04:15:19 +03:00
|
|
|
# BUILD_TYPE_OVERRIDE => channel type (canary, beta, or stable) - get the channel type (the api configs)
|
|
|
|
BUILD_TYPE_OVERRIDE: ${{ github.event.inputs.channel_override || 'beta' }}
|
2023-05-10 07:03:22 +03:00
|
|
|
|
|
|
|
jobs:
|
2023-05-15 19:07:51 +03:00
|
|
|
set-build-version:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment: production
|
|
|
|
outputs:
|
2023-07-14 08:21:43 +03:00
|
|
|
version: 0.0.0-internal.${{ steps.version.outputs.version }}
|
2023-05-15 19:07:51 +03:00
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-15 19:07:51 +03:00
|
|
|
- uses: toeverything/set-build-version@latest
|
|
|
|
- id: version
|
|
|
|
run: echo ::set-output name=version::${{ env.BUILD_VERSION }}
|
|
|
|
|
2023-05-10 07:03:22 +03:00
|
|
|
before-make:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
environment: production
|
2023-05-15 19:07:51 +03:00
|
|
|
needs:
|
|
|
|
- set-build-version
|
2023-05-10 07:03:22 +03:00
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-10 07:03:22 +03:00
|
|
|
- name: Setup Node.js
|
|
|
|
uses: ./.github/actions/setup-node
|
2023-08-03 20:26:30 +03:00
|
|
|
- name: Setup @sentry/cli
|
|
|
|
uses: ./.github/actions/setup-sentry
|
2023-05-11 06:23:29 +03:00
|
|
|
- name: Replace Version
|
2023-05-15 19:07:51 +03:00
|
|
|
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
|
2023-05-10 07:03:22 +03:00
|
|
|
- name: generate-assets
|
2023-10-18 18:30:08 +03:00
|
|
|
working-directory: packages/frontend/electron
|
2023-05-10 07:03:22 +03:00
|
|
|
run: yarn generate-assets
|
|
|
|
env:
|
|
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
|
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
|
|
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
|
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
2023-06-09 19:46:24 +03:00
|
|
|
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
|
2023-05-10 07:03:22 +03:00
|
|
|
|
2023-07-18 19:53:10 +03:00
|
|
|
- name: Upload core artifact
|
2023-05-10 07:03:22 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-07-18 19:53:10 +03:00
|
|
|
name: core
|
2023-10-18 18:30:08 +03:00
|
|
|
path: packages/frontend/electron/resources/web-static
|
2023-05-10 07:03:22 +03:00
|
|
|
|
|
|
|
make-distribution:
|
|
|
|
environment: production
|
|
|
|
strategy:
|
2023-08-24 07:34:36 +03:00
|
|
|
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
|
|
|
# For windows, we need a separate approach
|
2023-05-10 07:03:22 +03:00
|
|
|
matrix:
|
|
|
|
spec:
|
2023-08-24 07:34:36 +03:00
|
|
|
- runner: macos-latest
|
|
|
|
platform: darwin
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- runner: macos-latest
|
|
|
|
platform: darwin
|
|
|
|
arch: arm64
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
- runner: ubuntu-latest
|
|
|
|
platform: linux
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-unknown-linux-gnu
|
2023-08-24 10:26:49 +03:00
|
|
|
- runner: windows-latest
|
|
|
|
platform: win32
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-pc-windows-msvc
|
2023-08-24 09:52:13 +03:00
|
|
|
runs-on: ${{ matrix.spec.runner }}
|
2023-08-24 08:11:20 +03:00
|
|
|
needs:
|
|
|
|
- before-make
|
|
|
|
- set-build-version
|
2023-05-10 07:03:22 +03:00
|
|
|
env:
|
|
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
|
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
|
|
SKIP_GENERATE_ASSETS: 1
|
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-10 07:03:22 +03:00
|
|
|
- name: Setup Node.js
|
2023-08-04 03:58:42 +03:00
|
|
|
timeout-minutes: 10
|
2023-05-10 07:03:22 +03:00
|
|
|
uses: ./.github/actions/setup-node
|
2023-08-01 22:20:29 +03:00
|
|
|
- name: Setup Maker
|
2023-08-04 03:58:42 +03:00
|
|
|
timeout-minutes: 10
|
2023-08-01 22:20:29 +03:00
|
|
|
uses: ./.github/actions/setup-maker
|
2023-05-17 18:52:32 +03:00
|
|
|
- name: Build AFFiNE native
|
|
|
|
uses: ./.github/actions/build-rust
|
|
|
|
with:
|
|
|
|
target: ${{ matrix.spec.target }}
|
2023-08-29 13:07:05 +03:00
|
|
|
package: '@affine/native'
|
2023-06-19 12:38:26 +03:00
|
|
|
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
2023-08-24 08:11:20 +03:00
|
|
|
- name: Replace Version
|
|
|
|
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
|
2023-05-10 07:03:22 +03:00
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-07-25 21:41:32 +03:00
|
|
|
name: core
|
2023-10-18 18:30:08 +03:00
|
|
|
path: packages/frontend/electron/resources/web-static
|
2023-05-17 12:22:49 +03:00
|
|
|
|
2023-06-30 12:06:44 +03:00
|
|
|
- name: Build Plugins
|
|
|
|
run: yarn run build:plugins
|
|
|
|
|
|
|
|
- name: Build Desktop Layers
|
2023-07-01 11:34:30 +03:00
|
|
|
run: yarn workspace @affine/electron build
|
2023-05-10 07:03:22 +03:00
|
|
|
|
|
|
|
- name: Signing By Apple Developer ID
|
2023-05-17 12:22:49 +03:00
|
|
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
2023-05-10 07:03:22 +03:00
|
|
|
uses: apple-actions/import-codesign-certs@v2
|
|
|
|
with:
|
|
|
|
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
|
|
|
|
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
|
|
|
|
|
|
|
|
- name: make
|
2023-05-17 12:22:49 +03:00
|
|
|
run: yarn workspace @affine/electron make --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
2023-05-10 07:03:22 +03:00
|
|
|
|
|
|
|
- name: Save artifacts (mac)
|
2023-05-17 12:22:49 +03:00
|
|
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
2023-05-10 07:03:22 +03:00
|
|
|
run: |
|
|
|
|
mkdir -p builds
|
2023-10-18 18:30:08 +03:00
|
|
|
mv packages/frontend/electron/out/*/make/*.dmg ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
|
|
|
|
mv packages/frontend/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
|
2023-08-24 08:11:20 +03:00
|
|
|
- name: Save artifacts (windows)
|
|
|
|
if: ${{ matrix.spec.platform == 'win32' }}
|
|
|
|
run: |
|
|
|
|
mkdir -p builds
|
2023-10-18 18:30:08 +03:00
|
|
|
mv packages/frontend/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.zip
|
|
|
|
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.exe
|
|
|
|
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.msi ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.msi
|
|
|
|
mv packages/frontend/electron/out/*/make/squirrel.windows/x64/*.nupkg ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.nupkg
|
2023-08-24 08:11:20 +03:00
|
|
|
|
2023-05-10 07:03:22 +03:00
|
|
|
- name: Save artifacts (linux)
|
|
|
|
if: ${{ matrix.spec.platform == 'linux' }}
|
|
|
|
run: |
|
|
|
|
mkdir -p builds
|
2023-10-18 18:30:08 +03:00
|
|
|
mv packages/frontend/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.zip
|
|
|
|
mv packages/frontend/electron/out/*/make/AppImage/x64/*.AppImage ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.AppImage
|
2023-05-10 07:03:22 +03:00
|
|
|
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: affine-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}-builds
|
|
|
|
path: builds
|
2023-05-11 05:42:56 +03:00
|
|
|
|
|
|
|
release:
|
2023-05-15 19:07:51 +03:00
|
|
|
needs:
|
|
|
|
- make-distribution
|
|
|
|
- set-build-version
|
2023-05-11 05:42:56 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-05-11 05:42:56 +03:00
|
|
|
- name: Download Artifacts (macos-x64)
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-05-17 12:22:49 +03:00
|
|
|
name: affine-darwin-x64-builds
|
2023-05-11 05:42:56 +03:00
|
|
|
path: ./
|
|
|
|
- name: Download Artifacts (macos-arm64)
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-05-17 12:22:49 +03:00
|
|
|
name: affine-darwin-arm64-builds
|
2023-05-11 05:42:56 +03:00
|
|
|
path: ./
|
|
|
|
- name: Download Artifacts (windows-x64)
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-05-17 12:22:49 +03:00
|
|
|
name: affine-win32-x64-builds
|
2023-05-11 05:42:56 +03:00
|
|
|
path: ./
|
|
|
|
- name: Download Artifacts (linux-x64)
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: affine-linux-x64-builds
|
|
|
|
path: ./
|
|
|
|
- name: Setup Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- name: Generate Release yml
|
|
|
|
run: |
|
2023-10-18 18:30:08 +03:00
|
|
|
node ./packages/frontend/electron/scripts/generate-yml.js
|
2023-05-11 05:42:56 +03:00
|
|
|
env:
|
2023-05-15 19:07:51 +03:00
|
|
|
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
|
2023-05-11 05:42:56 +03:00
|
|
|
- name: Create Release Draft
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
with:
|
|
|
|
repository: 'toeverything/AFFiNE-Releases'
|
2023-05-15 19:07:51 +03:00
|
|
|
name: ${{ needs.set-build-version.outputs.version }}
|
|
|
|
tag_name: ${{ needs.set-build-version.outputs.version }}
|
2023-05-11 05:42:56 +03:00
|
|
|
prerelease: true
|
|
|
|
files: |
|
|
|
|
./VERSION
|
|
|
|
./*.zip
|
|
|
|
./*.dmg
|
|
|
|
./*.exe
|
2023-08-24 08:11:20 +03:00
|
|
|
./*.nupkg
|
|
|
|
./RELEASES
|
2023-05-11 05:42:56 +03:00
|
|
|
./*.AppImage
|
|
|
|
./*.apk
|
|
|
|
./*.yml
|