-
Notifications
You must be signed in to change notification settings - Fork 33
88 lines (77 loc) · 2.46 KB
/
pre-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Pre Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+
branches:
- master
- dev
jobs:
release:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
steps:
- name: Check out git repository
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- id: pkgversion
uses: ashley-taylor/read-json-property-action@v1.2
with:
path: ./package.json
property: version
- id: short_sha
run: echo "::set-output name=value::$(git rev-parse --short HEAD)"
- run: pnpm install
- run: pnpm run build
- run: pnpm run vscode:build-tpl
- name: rename vscode vsx
# working-directory 用于指定在哪个目录下执行命令
working-directory: ./packages/vscode
run: pnpm run build:rename
# https://github.com/HaaLeo/publish-vscode-extension
- name: build vscode vsx
if: matrix.os == 'windows-latest'
uses: HaaLeo/publish-vscode-extension@v1
id: publishVSX
with:
packagePath: ./packages/vscode
pat: ${{ secrets.VSCODE_TOKEN }}
# 不发布
dryRun: true
skipDuplicate: true
registryUrl: https://marketplace.visualstudio.com
yarn: false
- name: Build Electron App
run: pnpm electron:build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/softprops/action-gh-release
- name: release
uses: softprops/action-gh-release@v2.0.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.pkgversion.outputs.value }}-alpha.${{ steps.short_sha.outputs.value }}
name: v${{ steps.pkgversion.outputs.value }}-alpha.${{ steps.short_sha.outputs.value }}
prerelease: true
draft: true
files: |
packages/web/dist/electron/*.AppImage
packages/web/dist/electron/*.deb
packages/web/dist/electron/*.dmg
packages/web/dist/electron/*.exe
packages/web/dist/electron/*.rpm
packages/web/dist/electron/*.zip
packages/vscode/*.vsix