-
Notifications
You must be signed in to change notification settings - Fork 1
156 lines (134 loc) · 4.21 KB
/
release.yml
File metadata and controls
156 lines (134 loc) · 4.21 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Release
on:
push:
branches:
- master
jobs:
determine-next-release:
runs-on: ubuntu-latest
outputs:
next-release-version: ${{steps.capture-next-version.outputs.NEXT_RELEASE_VERSION}}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Fetch Next Version
id: fetch-next-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --branches "master" --dry-run
- name: Capture Next Version
id: capture-next-version
# RELEASE_VERSION by semantic-release in previous step, see .releaserc.json
run: echo "NEXT_RELEASE_VERSION=${{env.RELEASE_VERSION}}" >> $GITHUB_OUTPUT
publish-linux:
runs-on: ubuntu-latest
needs: determine-next-release
if: ${{needs.determine-next-release.outputs.next-release-version}}
env:
RELEASE_VERSION: ${{needs.determine-next-release.outputs.next-release-version}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@master
with:
node-version: 18
- name: install dependencies
run: npm install
- name: Publish Linux
run: npm run electron:package:linux
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: basic-blackjack_linux_x64.deb
path: dist/basic-blackjack_*.deb
publish-windows:
runs-on: windows-latest
needs: determine-next-release
if: ${{needs.determine-next-release.outputs.next-release-version}}
env:
RELEASE_VERSION: ${{needs.determine-next-release.outputs.next-release-version}}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 18
- name: install dependencies
run: npm install
- name: Publish Windows
run: npm run electron:package:win
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: basic-blackjack_win_x64.exe
path: dist/basic-blackjack_*.exe
release:
runs-on: ubuntu-latest
needs: [publish-linux, publish-windows]
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 18
- name: install dependencies
run: npm install
- uses: actions/download-artifact@v3
with:
name: basic-blackjack_linux_x64.deb
path: dist
- uses: actions/download-artifact@v3
with:
name: basic-blackjack_win_x64.exe
path: dist
- name: List contents
run: |
ls
ls dist
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --branches master
deploy-pages:
runs-on: ubuntu-latest
needs: determine-next-release
if: ${{needs.determine-next-release.outputs.next-release-version}}
env:
RELEASE_VERSION: ${{needs.determine-next-release.outputs.next-release-version}}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run build
env:
REACT_APP_VERSION: ${{env.RELEASE_VERSION}}
run: npm run build
# add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project. (Allow files and folders starting with an underscore)
- name: Add .nojekyll file
run: touch build/.nojekyll
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: build