-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (64 loc) · 1.85 KB
/
deno-build.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will install Deno then run `deno lint` and `deno test`.
# For more information see: https://github.com/denoland/setup-deno
name: Publish to release
on:
push:
branches: ['master']
paths:
- deno.json
permissions:
contents: read
jobs:
check:
uses: ./.github/workflows/check.yml
release:
runs-on: ubuntu-latest
needs: check
# 发布时需要提供写入权限
permissions:
contents: write
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- name: Setup repo
uses: actions/[email protected]
- name: Setup Deno
uses: denoland/[email protected]
with:
deno-version: v1.x
# 执行编译命令
- name: Run compile mac
run: deno task build:mac
- name: Run compile mac M
run: deno task build:mac-m
- name: Run compile windows
run: deno task build:win
- name: Run compile linux
run: deno task build:linux
# 创建版本文件
- name: 创建版本文件
id: create_version_file
run: |
deno task version
echo "TAG=$(cat ./release/version)" >> $GITHUB_ENV
# 发布到 Release
- name: Publish to Release
id: publish_release
uses: softprops/action-gh-release@v2
env:
TAG: ${{ env.TAG }}
with:
files: ./release/!(version)
name: ${{ env.TAG }}
tag_name: ${{ env.TAG }}
body: |
v ${{ env.TAG }}
draft: false
prerelease: false
# 发布到 JSR
- name: Publish to JSR
id: publish_jsr
run: deno publish