This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
generated from wuespace/telestion-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (89 loc) · 3.05 KB
/
publish-client.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
name: Publish Client Binaries
# Events that trigger this workflow
on:
workflow_run:
workflows: ["Release"]
types: [completed]
jobs:
update:
name: "Update package version"
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
defaults:
run:
working-directory: ./client
steps:
- name: Checkout 📥
uses: actions/[email protected]
with:
token: ${{ secrets.GH_RELEASE_TOKEN }}
- name: Download build environment 📥
uses: dawidd6/[email protected]
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: build-env
path: ${{ github.workspace }}
- name: Import environment ⛓
shell: bash
run: cat "${GITHUB_WORKSPACE}/.build-env" >> $GITHUB_ENV
- name: Update package version
run: |
sed -i 's/"version": "[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+"/"version": "'"$VERSION"'"/gm' package.json
env:
VERSION: ${{ env.version }}
- name: Commit changes
run: |
git config --local user.name "${GITHUB_ACTOR}"
git config --local user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "chore(client): Bump package version"
git push
publish:
name: "Build and publish for ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
needs: update
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
working-directory: ./client
steps:
- name: Checkout 📥
uses: actions/[email protected]
- name: Setup Node 💿
uses: actions/[email protected]
with:
node-version: 14
# Remove, when checkout error is resolved
# See https://github.com/actions/checkout/issues/439
- name: Pull latest changes
run: git pull origin main
# Remove, when setup-node action supports specifying the node version
- name: Install npm v7 ⬆
run: npm install --global npm@v7
- name: Download build environment 📥
uses: dawidd6/[email protected]
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: build-env
path: ${{ github.workspace }}
- name: Import environment ⛓
shell: bash
run: cat "${GITHUB_WORKSPACE}/.build-env" >> $GITHUB_ENV
- name: Install development dependencies 📚
run: npm ci
- name: Build binaries 🗜
run: npm run build
- name: Upload release assets 🪡
if: ${{ env.skipped == 'false' }}
uses: svenstaro/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.tag }}
file: ./client/dist/telestion-project-rocketsound*.*
file_glob: true