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
|
name: Release App
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
workflow_dispatch:
|
||||||
tags:
|
inputs:
|
||||||
- 'v*.*.*'
|
version:
|
||||||
paths-ignore:
|
description: App Vesion
|
||||||
- 'README.md'
|
required: false
|
||||||
- 'docs/**'
|
default: 0.1.0
|
||||||
- '.vscode'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths-ignore:
|
|
||||||
- 'docs/**'
|
|
||||||
- 'README.md'
|
|
||||||
- '.vscode'
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
actions: write
|
actions: write
|
||||||
@@ -31,27 +23,29 @@ jobs:
|
|||||||
create-release:
|
create-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
release_id: ${{ steps.create-release.outputs.result }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v2
|
||||||
- name: Query version number
|
- name: setup node
|
||||||
id: get_version
|
uses: actions/setup-node@v1
|
||||||
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 }}
|
|
||||||
with:
|
with:
|
||||||
draft: true
|
node-version: 16
|
||||||
tag_name: '${{ env.version }}'
|
- name: create release
|
||||||
release_name: 'AFFiNE ${{ env.version }}'
|
id: create-release
|
||||||
body: 'See the assets to download this version and install.'
|
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:
|
build-tauri:
|
||||||
needs: create-release
|
needs: create-release
|
||||||
@@ -85,24 +79,31 @@ jobs:
|
|||||||
workspaces: |
|
workspaces: |
|
||||||
apps/desktop/src-tauri
|
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
|
- 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
|
id: tauri-action
|
||||||
env:
|
env:
|
||||||
|
CI_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
releaseId: ${{ needs.create-release.outputs.release_id }}
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v3
|
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:
|
with:
|
||||||
name: tauri-client-app-artifact
|
script: |
|
||||||
path: |
|
github.rest.repos.updateRelease({
|
||||||
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[0] }}
|
owner: context.repo.owner,
|
||||||
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[1] }}
|
repo: context.repo.repo,
|
||||||
${{ fromJSON(steps.tauri-action.outputs.artifactPaths)[2] }}
|
release_id: process.env.release_id,
|
||||||
|
draft: false,
|
||||||
|
prerelease: true
|
||||||
|
})
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
"withGlobalTauri": false
|
"withGlobalTauri": false
|
||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "AFFiNE",
|
"productName": "Affine",
|
||||||
"version": "0.0.2"
|
"version": "0.1.0"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
Reference in New Issue
Block a user