-
Notifications
You must be signed in to change notification settings - Fork 8
124 lines (118 loc) · 3.55 KB
/
deploy.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
name: 'Deploy'
on:
push:
branches:
- main
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Determine Version
run: |
pushd .github/workflows/scripts
npm ci
popd
VERSION=$(node .github/workflows/scripts/determineVersion)
echo "Next Version: $VERSION"
echo "OGB_VERSION=$VERSION" >> $GITHUB_ENV
echo "OGB_TAGNAME=release/$VERSION" >> $GITHUB_ENV
- name: Push tag
run: |
git config user.name Releases
git config user.email [email protected]
git diff --quiet || git commit -am "Release $VERSION"
git tag "$OGB_TAGNAME"
git push origin "$OGB_TAGNAME"
- uses: actions/upload-artifact@v3
with:
name: packageJson
path: package.json
outputs:
version: ${{ env.OGB_VERSION }}
tagName: ${{ env.OGB_TAGNAME }}
build_win:
needs: [version]
runs-on: ubuntu-latest
container:
image: electronuserland/builder:wine
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: packageJson
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build
run: |
npm ci --platform=win32
(cd src/main && npx webpack)
(cd src/frontend && npx webpack)
npx electron-builder --win
env:
HOME: /root
- uses: actions/upload-artifact@v3
with:
name: windows
path: dist/OscGoesBrrr-setup.exe
release:
needs: [version, build_win]
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
path: repo
- name: Checkout version manifest
uses: actions/checkout@v3
with:
path: versions
repository: OSCToys/ogb-updater-manifest
ssh-key: ${{ secrets.VERSION_DEPLOY_KEY }}
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: windows
path: windows
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.version.outputs.tagName }}
name: Release ${{ needs.version.outputs.version }}
files: |
windows/OscGoesBrrr-setup.exe
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Update Version Manifest
run: |
pushd repo/.github/workflows/scripts
npm ci
popd
pushd versions
node ../repo/.github/workflows/scripts/updateManifest "$VERSION" "$DOWNLOAD_URL"
popd
env:
VERSION: ${{ needs.version.outputs.version }}
DOWNLOAD_URL: ${{ fromJSON(steps.release.outputs.assets)[0].browser_download_url }}
- name: Push version manifest
working-directory: versions
run: |
git diff
git config user.name Releases
git config user.email [email protected]
git diff --quiet || git commit -am "Release from $GITHUB_SHA"
git push