mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: modify tauri client release workflow (#1532)
This commit is contained in:
95
.github/workflows/client-app.yml
vendored
95
.github/workflows/client-app.yml
vendored
@@ -1,20 +1,12 @@
|
||||
name: Release App
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
paths-ignore:
|
||||
- 'README.md'
|
||||
- 'docs/**'
|
||||
- '.vscode'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- 'README.md'
|
||||
- '.vscode'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: App Vesion
|
||||
required: false
|
||||
default: 0.1.0
|
||||
|
||||
permissions:
|
||||
actions: write
|
||||
@@ -31,27 +23,29 @@ jobs:
|
||||
create-release:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
||||
release_id: ${{ steps.create-release.outputs.result }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Query version number
|
||||
id: get_version
|
||||
shell: bash
|
||||
run: |
|
||||
echo "using version tag ${GITHUB_REF:10}"
|
||||
echo "version=${GITHUB_REF:10}" >> $GITHUB_ENV
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
draft: true
|
||||
tag_name: '${{ env.version }}'
|
||||
release_name: 'AFFiNE ${{ env.version }}'
|
||||
body: 'See the assets to download this version and install.'
|
||||
node-version: 16
|
||||
- name: create release
|
||||
id: create-release
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const { data } = await github.rest.repos.createRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag_name: `affine-client-v${{ github.event.inputs.version }}`,
|
||||
name: `Affine Client v${{ github.event.inputs.version }}`,
|
||||
body: 'Take a look at the assets to download and install this app.',
|
||||
draft: true,
|
||||
prerelease: false
|
||||
})
|
||||
return data.id
|
||||
|
||||
build-tauri:
|
||||
needs: create-release
|
||||
@@ -85,24 +79,31 @@ jobs:
|
||||
workspaces: |
|
||||
apps/desktop/src-tauri
|
||||
|
||||
- name: Make App Binary
|
||||
run: pnpm build:client
|
||||
env:
|
||||
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload to release on git tag Or output artifact path on nightly
|
||||
uses: tauri-apps/tauri-action@dev
|
||||
uses: tauri-apps/tauri-action@v0
|
||||
id: tauri-action
|
||||
env:
|
||||
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
releaseId: ${{ needs.create-release.outputs.release_id }}
|
||||
|
||||
publish-release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [create-release, build-tauri]
|
||||
|
||||
steps:
|
||||
- name: publish pre release
|
||||
id: publish-pre-release
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
release_id: ${{ needs.create-release.outputs.release_id }}
|
||||
with:
|
||||
name: tauri-client-app-artifact
|
||||
path: |
|
||||
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[0] }}
|
||||
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[1] }}
|
||||
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[2] }}
|
||||
script: |
|
||||
github.rest.repos.updateRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
release_id: process.env.release_id,
|
||||
draft: false,
|
||||
prerelease: true
|
||||
})
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
"withGlobalTauri": false
|
||||
},
|
||||
"package": {
|
||||
"productName": "AFFiNE",
|
||||
"version": "0.0.2"
|
||||
"productName": "Affine",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
Reference in New Issue
Block a user