-
Notifications
You must be signed in to change notification settings - Fork 28
142 lines (128 loc) · 4.16 KB
/
beta-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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: 'Release Beta Version'
on:
workflow_dispatch:
schedule:
- cron: '42 22 * * *'
jobs:
get-commit:
name: Get commit message
runs-on: ubuntu-latest
outputs:
msg: ${{ steps.set-msg.outputs.msg }}
steps:
- name: 'Checkout repository'
uses: 'actions/checkout@v4'
with:
fetch-depth: 0
persist-credentials: false
- id: set-msg
name: 'Set commit message variable'
run: |
commitMessages=$(git log $(git describe --tags --abbrev=0)..@ --pretty=format:"%s" --no-merges | sed '/chore(deps/d' | sed '2,$d')
echo "msg=${commitMessages}"
echo "msg=${commitMessages}" >> $GITHUB_OUTPUT
bump-version:
name: 'Bump version'
needs: get-commit
if: ${{ needs.get-commit.outputs.msg != '' && needs.get-commit.outputs.msg != null && !contains(needs.get-commit.outputs.msg, 'chore(release)') && !contains(needs.get-commit.outputs.msg, 'version bump') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 'Checkout repository'
uses: 'actions/checkout@v4'
with:
persist-credentials: false
- name: 'Automated Version Bump'
id: version-bump
uses: 'phips28/[email protected]'
with:
version-type: prerelease
preid: 'beta'
tag-prefix: 'v'
skip-tag: 'true'
bump-policy: 'last-commit'
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
- name: 'Output new version'
env:
NEW_VERSION: ${{ steps.version-bump.outputs.newTag }}
run: echo "new version $NEW_VERSION"
outputs:
newTag: ${{ steps.version-bump.outputs.newTag }}
draft-release:
name: 'Draft release'
runs-on: ubuntu-latest
needs: bump-version
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create draft release
id: create_release
uses: ncipollo/release-action@v1
with:
name: ${{ needs.bump-version.outputs.newTag }}
tag: ${{ needs.bump-version.outputs.newTag }}
commit: 'master'
draft: true
prerelease: true
generateReleaseNotes: true
outputs:
id: ${{ steps.create_release.outputs.id }}
build:
runs-on: ${{ matrix.os }}
needs: draft-release
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: master
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 16
check-latest: true
cache: 'yarn'
- name: Install dependencies
if: matrix.os != 'windows-latest'
run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 yarn install
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: yarn install
- name: Set env variables
run: |
touch .env
echo SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }} >> .env
echo SENTRY_ORG=${{ secrets.SENTRY_ORG }} >> .env
echo SENTRY_PROJECT=${{ secrets.SENTRY_PROJECT }} >> .env
echo SENTRY_DSN=${{ secrets.SENTRY_DSN }} >> .env
echo SENTRY_SOURCE_MAPS=1 >> .env
echo ZOOM_SDK_KEY=${{ secrets.ZOOM_SDK_KEY }} >> .env
echo ZOOM_SIGNATURE_ENDPOINT=${{ secrets.ZOOM_SIGNATURE_ENDPOINT }} >> .env
- name: Prepare build
run: |
yarn prebuild
yarn compile
- name: Build Electron app
env:
GH_TOKEN: ${{ secrets.github_token }}
run: yarn run build -p always
publish-release:
name: 'Publish release'
runs-on: ubuntu-latest
needs: [bump-version, build]
steps:
- uses: ncipollo/release-action@v1
with:
name: ${{ needs.bump-version.outputs.newTag }}
tag: ${{ needs.bump-version.outputs.newTag }}
draft: false
prerelease: true
allowUpdates: true
omitBodyDuringUpdate: true
updateOnlyUnreleased: true
token: ${{ secrets.PERSONAL_TOKEN }}