2023-03-28 09:08:17 +03:00
|
|
|
name: Release Desktop App
|
2023-01-04 12:16:26 +03:00
|
|
|
|
|
|
|
on:
|
2023-03-11 15:35:38 +03:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2023-12-21 10:58:16 +03:00
|
|
|
build-type:
|
|
|
|
description: 'Build Type'
|
|
|
|
type: choice
|
2023-03-16 17:58:21 +03:00
|
|
|
required: true
|
2023-12-21 10:58:16 +03:00
|
|
|
default: canary
|
|
|
|
options:
|
|
|
|
- canary
|
|
|
|
- beta
|
|
|
|
- stable
|
2023-03-16 17:58:21 +03:00
|
|
|
is-draft:
|
|
|
|
description: 'Draft Release?'
|
|
|
|
type: boolean
|
|
|
|
required: true
|
|
|
|
default: true
|
|
|
|
is-pre-release:
|
|
|
|
description: 'Pre Release? (labeled as "PreRelease")'
|
|
|
|
type: boolean
|
|
|
|
required: true
|
|
|
|
default: true
|
2023-01-04 12:16:26 +03:00
|
|
|
|
2023-02-14 09:51:05 +03:00
|
|
|
permissions:
|
|
|
|
actions: write
|
|
|
|
contents: write
|
|
|
|
security-events: write
|
2024-07-30 07:24:16 +03:00
|
|
|
id-token: write
|
|
|
|
attestations: write
|
2023-02-14 09:51:05 +03:00
|
|
|
|
2023-04-17 19:32:10 +03:00
|
|
|
env:
|
2023-12-21 10:58:16 +03:00
|
|
|
BUILD_TYPE: ${{ github.event.inputs.build-type }}
|
2023-05-10 13:38:23 +03:00
|
|
|
DEBUG: napi:*
|
|
|
|
APP_NAME: affine
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
2023-04-17 19:32:10 +03:00
|
|
|
|
2023-04-04 15:40:07 +03:00
|
|
|
jobs:
|
2023-04-18 12:50:29 +03:00
|
|
|
before-make:
|
|
|
|
runs-on: ubuntu-latest
|
2023-12-21 10:58:16 +03:00
|
|
|
environment: ${{ github.event.inputs.build-type }}
|
2023-06-28 18:53:32 +03:00
|
|
|
outputs:
|
2023-12-21 10:58:16 +03:00
|
|
|
RELEASE_VERSION: ${{ steps.version.outputs.APP_VERSION }}
|
2023-04-18 12:50:29 +03:00
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-21 10:58:16 +03:00
|
|
|
- name: Setup Version
|
2023-12-21 13:00:12 +03:00
|
|
|
id: version
|
2023-12-21 10:58:16 +03:00
|
|
|
uses: ./.github/actions/setup-version
|
2023-04-18 12:50:29 +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-04-18 12:50:29 +03:00
|
|
|
- name: generate-assets
|
2023-05-17 12:22:49 +03:00
|
|
|
run: yarn workspace @affine/electron generate-assets
|
2023-04-18 12:50:29 +03:00
|
|
|
env:
|
|
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
2024-04-15 07:27:43 +03:00
|
|
|
SENTRY_PROJECT: 'affine'
|
2023-04-18 12:50:29 +03:00
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
2023-12-01 10:25:08 +03:00
|
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
2024-07-23 11:05:05 +03:00
|
|
|
SENTRY_RELEASE: ${{ steps.version.outputs.APP_VERSION }}
|
2023-12-21 10:58:16 +03:00
|
|
|
RELEASE_VERSION: ${{ steps.version.outputs.APP_VERSION }}
|
2023-11-28 09:59:50 +03:00
|
|
|
SKIP_NX_CACHE: 'true'
|
2024-04-15 07:27:43 +03:00
|
|
|
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
2023-04-18 12:50:29 +03:00
|
|
|
|
2024-03-19 10:48:56 +03:00
|
|
|
- name: Upload web artifact
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-04-18 12:50:29 +03:00
|
|
|
with:
|
2024-03-19 10:48:56 +03:00
|
|
|
name: web
|
2024-09-12 10:42:57 +03:00
|
|
|
path: packages/frontend/apps/electron/resources/web-static
|
2023-04-18 12:50:29 +03:00
|
|
|
|
|
|
|
make-distribution:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
spec:
|
2024-02-01 12:03:07 +03:00
|
|
|
- runner: macos-14
|
2023-08-22 18:16:26 +03:00
|
|
|
platform: darwin
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-apple-darwin
|
2024-02-01 12:03:07 +03:00
|
|
|
- runner: macos-14
|
2023-08-22 18:16:26 +03:00
|
|
|
platform: darwin
|
|
|
|
arch: arm64
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
- runner: ubuntu-latest
|
|
|
|
platform: linux
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
runs-on: ${{ matrix.spec.runner }}
|
2023-04-18 12:50:29 +03:00
|
|
|
needs: before-make
|
2023-04-12 18:23:47 +03:00
|
|
|
env:
|
|
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
|
|
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
|
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
2023-04-18 12:50:29 +03:00
|
|
|
SKIP_GENERATE_ASSETS: 1
|
2024-03-28 13:24:25 +03:00
|
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
2024-04-15 07:27:43 +03:00
|
|
|
SENTRY_PROJECT: 'affine'
|
2024-03-28 13:24:25 +03:00
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
2024-04-15 07:27:43 +03:00
|
|
|
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
2023-03-16 17:58:21 +03:00
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-21 17:15:22 +03:00
|
|
|
- name: Setup Version
|
|
|
|
id: version
|
|
|
|
uses: ./.github/actions/setup-version
|
2023-03-24 18:44:14 +03:00
|
|
|
- name: Setup Node.js
|
2023-08-24 00:52:34 +03:00
|
|
|
timeout-minutes: 10
|
2023-03-24 18:44:14 +03:00
|
|
|
uses: ./.github/actions/setup-node
|
2023-10-17 09:15:55 +03:00
|
|
|
with:
|
|
|
|
extra-flags: workspaces focus @affine/electron @affine/monorepo
|
|
|
|
hard-link-nm: false
|
|
|
|
nmHoistingLimits: workspaces
|
2023-11-09 14:58:55 +03:00
|
|
|
enableScripts: false
|
2023-05-10 13:38:23 +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-12-26 15:40:10 +03:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-04-18 12:50:29 +03:00
|
|
|
with:
|
2024-03-19 10:48:56 +03:00
|
|
|
name: web
|
2024-09-12 10:42:57 +03:00
|
|
|
path: packages/frontend/apps/electron/resources/web-static
|
2023-05-17 12:22:49 +03:00
|
|
|
|
2023-06-30 12:06:44 +03:00
|
|
|
- name: Build Desktop Layers
|
2023-07-01 11:34:30 +03:00
|
|
|
run: yarn workspace @affine/electron build
|
2023-03-16 17:58:21 +03:00
|
|
|
|
2023-04-04 00:39:25 +03:00
|
|
|
- name: Signing By Apple Developer ID
|
2023-05-17 12:22:49 +03:00
|
|
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
2024-05-11 08:32:41 +03:00
|
|
|
uses: apple-actions/import-codesign-certs@v3
|
2023-04-04 00:39:25 +03:00
|
|
|
with:
|
|
|
|
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
|
|
|
|
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
|
|
|
|
|
2024-10-10 12:51:32 +03:00
|
|
|
- name: Install additional dependencies on Linux
|
2024-04-01 10:14:48 +03:00
|
|
|
if: ${{ matrix.spec.platform == 'linux' }}
|
|
|
|
run: |
|
|
|
|
sudo add-apt-repository universe
|
2024-10-10 12:51:32 +03:00
|
|
|
sudo apt install -y libfuse2 elfutils flatpak flatpak-builder
|
|
|
|
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
|
|
flatpak update
|
|
|
|
# some flatpak deps need git protocol.file.allow
|
|
|
|
git config --global protocol.file.allow always
|
2024-04-01 10:14:48 +03:00
|
|
|
|
2023-04-18 12:50:29 +03:00
|
|
|
- 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-10-17 09:15:55 +03:00
|
|
|
env:
|
|
|
|
SKIP_WEB_BUILD: 1
|
|
|
|
HOIST_NODE_MODULES: 1
|
2024-10-10 12:51:32 +03:00
|
|
|
DEBUG: '*'
|
2023-03-11 15:35:38 +03:00
|
|
|
|
2024-02-27 09:35:46 +03:00
|
|
|
- name: signing DMG
|
|
|
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
|
|
|
run: |
|
2024-09-12 10:42:57 +03:00
|
|
|
codesign --force --sign "Developer ID Application: TOEVERYTHING PTE. LTD." packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make/AFFiNE.dmg
|
2024-02-27 09:35:46 +03:00
|
|
|
|
2023-04-18 12:50:29 +03:00
|
|
|
- name: Save artifacts (mac)
|
2023-05-17 12:22:49 +03:00
|
|
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
2023-03-16 17:58:21 +03:00
|
|
|
run: |
|
|
|
|
mkdir -p builds
|
2024-09-12 10:42:57 +03:00
|
|
|
mv packages/frontend/apps/electron/out/*/make/*.dmg ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
|
|
|
|
mv packages/frontend/apps/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
|
2023-04-18 12:50:29 +03:00
|
|
|
- name: Save artifacts (linux)
|
2023-04-18 19:21:44 +03:00
|
|
|
if: ${{ matrix.spec.platform == 'linux' }}
|
2023-04-17 19:32:10 +03:00
|
|
|
run: |
|
|
|
|
mkdir -p builds
|
2024-09-12 10:42:57 +03:00
|
|
|
mv packages/frontend/apps/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.zip
|
|
|
|
mv packages/frontend/apps/electron/out/*/make/*.AppImage ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.appimage
|
2024-10-10 12:51:32 +03:00
|
|
|
mv packages/frontend/apps/electron/out/*/make/deb/x64/*.deb ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.deb
|
2024-10-10 12:51:32 +03:00
|
|
|
mv packages/frontend/apps/electron/out/*/make/flatpak/*/*.flatpak ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.flatpak
|
|
|
|
|
2024-07-30 07:24:16 +03:00
|
|
|
- uses: actions/attest-build-provenance@v1
|
|
|
|
if: ${{ matrix.spec.platform == 'darwin' }}
|
|
|
|
with:
|
|
|
|
subject-path: |
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
|
|
|
|
|
|
|
|
- uses: actions/attest-build-provenance@v1
|
|
|
|
if: ${{ matrix.spec.platform == 'linux' }}
|
|
|
|
with:
|
|
|
|
subject-path: |
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.zip
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.appimage
|
2024-10-10 12:51:32 +03:00
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.deb
|
2023-04-17 19:32:10 +03:00
|
|
|
- name: Upload Artifact
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-04-17 19:32:10 +03:00
|
|
|
with:
|
2023-04-18 19:21:44 +03:00
|
|
|
name: affine-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}-builds
|
2023-04-17 19:32:10 +03:00
|
|
|
path: builds
|
|
|
|
|
2024-07-31 13:00:19 +03:00
|
|
|
package-distribution-windows:
|
2023-08-22 18:16:26 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
spec:
|
|
|
|
- runner: windows-latest
|
|
|
|
platform: win32
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
runs-on: ${{ matrix.spec.runner }}
|
|
|
|
needs: before-make
|
2024-07-31 13:00:19 +03:00
|
|
|
outputs:
|
|
|
|
FILES_TO_BE_SIGNED: ${{ steps.get_files_to_be_signed.outputs.FILES_TO_BE_SIGNED }}
|
2023-08-22 18:16:26 +03:00
|
|
|
env:
|
|
|
|
SKIP_GENERATE_ASSETS: 1
|
2024-03-28 13:24:25 +03:00
|
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
2024-04-15 07:27:43 +03:00
|
|
|
SENTRY_PROJECT: 'affine'
|
2024-03-28 13:24:25 +03:00
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
2024-04-15 07:27:43 +03:00
|
|
|
MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
|
2023-08-22 18:16:26 +03:00
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-21 17:15:22 +03:00
|
|
|
- name: Setup Version
|
|
|
|
id: version
|
|
|
|
uses: ./.github/actions/setup-version
|
2023-08-22 18:16:26 +03:00
|
|
|
- name: Setup Node.js
|
|
|
|
timeout-minutes: 10
|
|
|
|
uses: ./.github/actions/setup-node
|
2023-10-17 09:15:55 +03:00
|
|
|
with:
|
|
|
|
extra-flags: workspaces focus @affine/electron @affine/monorepo
|
|
|
|
hard-link-nm: false
|
|
|
|
nmHoistingLimits: workspaces
|
2023-08-22 18:16:26 +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-08-22 18:16:26 +03:00
|
|
|
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
2023-12-26 15:40:10 +03:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-08-22 18:16:26 +03:00
|
|
|
with:
|
2024-03-19 10:48:56 +03:00
|
|
|
name: web
|
2024-09-12 10:42:57 +03:00
|
|
|
path: packages/frontend/apps/electron/resources/web-static
|
2023-08-22 18:16:26 +03:00
|
|
|
|
|
|
|
- name: Build Desktop Layers
|
|
|
|
run: yarn workspace @affine/electron build
|
|
|
|
|
|
|
|
- name: package
|
|
|
|
run: yarn workspace @affine/electron package --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
2023-10-17 09:15:55 +03:00
|
|
|
env:
|
|
|
|
SKIP_WEB_BUILD: 1
|
|
|
|
HOIST_NODE_MODULES: 1
|
2023-08-22 18:16:26 +03:00
|
|
|
|
2024-07-31 13:00:19 +03:00
|
|
|
- name: get all files to be signed
|
|
|
|
id: get_files_to_be_signed
|
|
|
|
run: |
|
2024-09-18 06:06:56 +03:00
|
|
|
Set-Variable -Name FILES_TO_BE_SIGNED -Value ((Get-ChildItem -Path packages/frontend/apps/electron/out -Recurse -File | Where-Object { $_.Extension -in @(".exe", ".node", ".dll", ".msi") } | ForEach-Object { '"' + $_.FullName.Replace((Get-Location).Path + '\packages\frontend\apps\electron\out\', '') + '"' }) -join ' ')
|
2024-07-31 13:00:19 +03:00
|
|
|
"FILES_TO_BE_SIGNED=$FILES_TO_BE_SIGNED" >> $env:GITHUB_OUTPUT
|
|
|
|
echo $FILES_TO_BE_SIGNED
|
|
|
|
|
|
|
|
- name: Zip artifacts for faster upload
|
2024-09-12 10:42:57 +03:00
|
|
|
run: Compress-Archive -CompressionLevel Fastest -Path packages/frontend/apps/electron/out/* -DestinationPath archive.zip
|
2024-07-31 13:00:19 +03:00
|
|
|
|
|
|
|
- name: Save packaged artifacts for signing
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: packaged-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
|
|
|
path: |
|
|
|
|
archive.zip
|
|
|
|
!**/*.map
|
|
|
|
|
|
|
|
sign-packaged-artifacts-windows:
|
|
|
|
needs: package-distribution-windows
|
|
|
|
uses: ./.github/workflows/windows-signer.yml
|
|
|
|
with:
|
|
|
|
files: ${{ needs.package-distribution-windows.outputs.FILES_TO_BE_SIGNED }}
|
|
|
|
artifact-name: packaged-win32-x64
|
|
|
|
|
|
|
|
make-windows-installer:
|
|
|
|
needs: sign-packaged-artifacts-windows
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
spec:
|
|
|
|
- runner: windows-latest
|
|
|
|
platform: win32
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
runs-on: ${{ matrix.spec.runner }}
|
|
|
|
outputs:
|
|
|
|
FILES_TO_BE_SIGNED: ${{ steps.get_files_to_be_signed.outputs.FILES_TO_BE_SIGNED }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Version
|
|
|
|
id: version
|
|
|
|
uses: ./.github/actions/setup-version
|
|
|
|
- name: Setup Node.js
|
|
|
|
timeout-minutes: 10
|
|
|
|
uses: ./.github/actions/setup-node
|
|
|
|
with:
|
|
|
|
extra-flags: workspaces focus @affine/electron @affine/monorepo
|
|
|
|
hard-link-nm: false
|
|
|
|
nmHoistingLimits: workspaces
|
|
|
|
- name: Download and overwrite packaged artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: signed-packaged-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
|
|
|
path: .
|
|
|
|
- name: unzip file
|
2024-09-12 10:42:57 +03:00
|
|
|
run: Expand-Archive -Path signed.zip -DestinationPath packages/frontend/apps/electron/out
|
2024-07-31 13:00:19 +03:00
|
|
|
|
2023-08-22 18:16:26 +03:00
|
|
|
- name: Make squirrel.windows installer
|
|
|
|
run: yarn workspace @affine/electron make-squirrel --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
|
|
|
|
2024-04-25 06:52:27 +03:00
|
|
|
- name: Make nsis.windows installer
|
|
|
|
run: yarn workspace @affine/electron make-nsis --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
|
|
|
|
|
2024-07-31 13:00:19 +03:00
|
|
|
- name: Zip artifacts for faster upload
|
2024-09-12 10:42:57 +03:00
|
|
|
run: Compress-Archive -CompressionLevel Fastest -Path packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make/* -DestinationPath archive.zip
|
2024-07-31 13:00:19 +03:00
|
|
|
|
|
|
|
- name: get all files to be signed
|
|
|
|
id: get_files_to_be_signed
|
|
|
|
run: |
|
2024-09-18 06:06:56 +03:00
|
|
|
Set-Variable -Name FILES_TO_BE_SIGNED -Value ((Get-ChildItem -Path packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make -Recurse -File | Where-Object { $_.Extension -in @(".exe", ".node", ".dll", ".msi") } | ForEach-Object { '"' + $_.FullName.Replace((Get-Location).Path + '\packages\frontend\apps\electron\out\${{ env.BUILD_TYPE }}\make\', '') + '"' }) -join ' ')
|
2024-07-31 13:00:19 +03:00
|
|
|
"FILES_TO_BE_SIGNED=$FILES_TO_BE_SIGNED" >> $env:GITHUB_OUTPUT
|
|
|
|
echo $FILES_TO_BE_SIGNED
|
|
|
|
|
|
|
|
- name: Save installer for signing
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: installer-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
|
|
|
path: archive.zip
|
|
|
|
|
|
|
|
sign-installer-artifacts-windows:
|
|
|
|
needs: make-windows-installer
|
|
|
|
uses: ./.github/workflows/windows-signer.yml
|
|
|
|
with:
|
|
|
|
files: ${{ needs.make-windows-installer.outputs.FILES_TO_BE_SIGNED }}
|
|
|
|
artifact-name: installer-win32-x64
|
|
|
|
|
|
|
|
finalize-installer-windows:
|
|
|
|
needs: [sign-installer-artifacts-windows, before-make]
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
spec:
|
|
|
|
- runner: windows-latest
|
|
|
|
platform: win32
|
|
|
|
arch: x64
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
runs-on: ${{ matrix.spec.runner }}
|
|
|
|
steps:
|
|
|
|
- name: Download and overwrite installer artifacts
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: signed-installer-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
|
|
|
|
path: .
|
|
|
|
- name: unzip file
|
2024-09-12 10:42:57 +03:00
|
|
|
run: Expand-Archive -Path signed.zip -DestinationPath packages/frontend/apps/electron/out/${{ env.BUILD_TYPE }}/make
|
2024-07-31 13:00:19 +03:00
|
|
|
|
2023-08-22 18:16:26 +03:00
|
|
|
- name: Save artifacts
|
|
|
|
run: |
|
|
|
|
mkdir -p builds
|
2024-09-12 10:42:57 +03:00
|
|
|
mv packages/frontend/apps/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.zip
|
|
|
|
mv packages/frontend/apps/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.exe
|
|
|
|
mv packages/frontend/apps/electron/out/*/make/nsis.windows/x64/*.exe ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.nsis.exe
|
2023-08-22 18:16:26 +03:00
|
|
|
|
2024-07-30 07:24:16 +03:00
|
|
|
- uses: actions/attest-build-provenance@v1
|
|
|
|
with:
|
|
|
|
subject-path: |
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.zip
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.exe
|
|
|
|
./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-windows-x64.nsis.exe
|
|
|
|
|
2023-08-22 18:16:26 +03:00
|
|
|
- name: Upload Artifact
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-08-22 18:16:26 +03:00
|
|
|
with:
|
|
|
|
name: affine-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}-builds
|
|
|
|
path: builds
|
|
|
|
|
2023-03-16 17:58:21 +03:00
|
|
|
release:
|
2024-07-31 13:00:19 +03:00
|
|
|
needs: [before-make, make-distribution, finalize-installer-windows]
|
2023-03-16 17:58:21 +03:00
|
|
|
runs-on: ubuntu-latest
|
2023-04-18 17:20:34 +03:00
|
|
|
|
2023-03-11 15:35:38 +03:00
|
|
|
steps:
|
2023-09-29 06:02:26 +03:00
|
|
|
- uses: actions/checkout@v4
|
2023-12-26 15:40:10 +03:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-09-29 06:02:26 +03:00
|
|
|
with:
|
2024-03-19 10:48:56 +03:00
|
|
|
name: web
|
2023-09-29 06:02:26 +03:00
|
|
|
path: web-static
|
|
|
|
- name: Zip web-static
|
|
|
|
run: zip -r web-static.zip web-static
|
2023-04-18 17:20:34 +03:00
|
|
|
- name: Download Artifacts (macos-x64)
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/download-artifact@v4
|
2023-04-17 19:32:10 +03:00
|
|
|
with:
|
2023-05-17 12:22:49 +03:00
|
|
|
name: affine-darwin-x64-builds
|
2023-04-18 17:20:34 +03:00
|
|
|
path: ./
|
|
|
|
- name: Download Artifacts (macos-arm64)
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/download-artifact@v4
|
2023-04-18 17:20:34 +03:00
|
|
|
with:
|
2023-05-17 12:22:49 +03:00
|
|
|
name: affine-darwin-arm64-builds
|
2023-04-18 17:20:34 +03:00
|
|
|
path: ./
|
|
|
|
- name: Download Artifacts (windows-x64)
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/download-artifact@v4
|
2023-04-18 17:20:34 +03:00
|
|
|
with:
|
2023-05-17 12:22:49 +03:00
|
|
|
name: affine-win32-x64-builds
|
2023-04-18 17:20:34 +03:00
|
|
|
path: ./
|
|
|
|
- name: Download Artifacts (linux-x64)
|
2023-12-26 15:40:10 +03:00
|
|
|
uses: actions/download-artifact@v4
|
2023-04-18 17:20:34 +03:00
|
|
|
with:
|
|
|
|
name: affine-linux-x64-builds
|
2023-04-17 19:32:10 +03:00
|
|
|
path: ./
|
2023-10-24 08:59:16 +03:00
|
|
|
- uses: actions/setup-node@v4
|
2023-05-03 07:13:40 +03:00
|
|
|
with:
|
2024-07-30 07:24:16 +03:00
|
|
|
node-version: 20
|
2023-05-03 07:13:40 +03:00
|
|
|
- name: Generate Release yml
|
|
|
|
run: |
|
2024-09-12 10:42:57 +03:00
|
|
|
node ./packages/frontend/apps/electron/scripts/generate-yml.js
|
2023-05-17 12:22:49 +03:00
|
|
|
env:
|
2023-12-21 10:58:16 +03:00
|
|
|
RELEASE_VERSION: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
2023-03-16 17:58:21 +03:00
|
|
|
- name: Create Release Draft
|
2023-12-29 12:00:10 +03:00
|
|
|
if: ${{ github.ref_type == 'tag' }}
|
2024-03-11 05:25:33 +03:00
|
|
|
uses: softprops/action-gh-release@v2
|
2023-02-14 18:18:47 +03:00
|
|
|
with:
|
2023-12-21 10:58:16 +03:00
|
|
|
name: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
2023-06-28 18:53:32 +03:00
|
|
|
body: ''
|
2023-12-21 10:58:16 +03:00
|
|
|
draft: ${{ github.event.inputs.is-draft }}
|
|
|
|
prerelease: ${{ github.event.inputs.is-pre-release }}
|
2023-03-16 17:58:21 +03:00
|
|
|
files: |
|
|
|
|
./VERSION
|
|
|
|
./*.zip
|
|
|
|
./*.dmg
|
|
|
|
./*.exe
|
2024-03-05 06:27:51 +03:00
|
|
|
./*.appimage
|
2024-10-10 12:51:32 +03:00
|
|
|
./*.deb
|
2024-10-10 12:51:32 +03:00
|
|
|
./*.flatpak
|
2023-03-16 17:58:21 +03:00
|
|
|
./*.apk
|
2023-05-03 07:13:40 +03:00
|
|
|
./*.yml
|
2023-12-29 12:00:10 +03:00
|
|
|
- name: Create Nightly Release Draft
|
|
|
|
if: ${{ github.ref_type == 'branch' }}
|
2024-03-11 05:25:33 +03:00
|
|
|
uses: softprops/action-gh-release@v2
|
2023-12-29 12:00:10 +03:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
|
|
with:
|
|
|
|
# Temporarily, treat release from branch as nightly release, artifact saved to AFFiNE-Releases.
|
|
|
|
# Need to improve internal build and nightly release logic.
|
|
|
|
repository: 'toeverything/AFFiNE-Releases'
|
|
|
|
name: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
|
|
|
tag_name: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
|
|
|
body: ''
|
|
|
|
draft: false
|
|
|
|
prerelease: true
|
|
|
|
files: |
|
|
|
|
./VERSION
|
|
|
|
./*.zip
|
|
|
|
./*.dmg
|
|
|
|
./*.exe
|
2024-03-05 06:27:51 +03:00
|
|
|
./*.appimage
|
2024-10-10 12:51:32 +03:00
|
|
|
./*.deb
|
2023-12-29 12:00:10 +03:00
|
|
|
./*.apk
|
2024-10-10 12:51:32 +03:00
|
|
|
./*.flatpak
|
2023-12-29 12:00:10 +03:00
|
|
|
./*.yml
|