-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (60 loc) · 2.19 KB
/
build-windows.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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build Windows Binaries
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: windows-latest
defaults:
run:
working-directory: ./server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: "npm"
node-version-file: "./server/.nvmrc"
cache-dependency-path: "server/package-lock.json"
- uses: jozsefsallai/node-package-version@v1.0.4
with:
path: server/package.json
- uses: benjlevesque/short-sha@v3.0
- run: npm ci
working-directory: ./server
- run: npm run build:windows
working-directory: ./server
- name: archive
run: Compress-Archive -LiteralPath win -DestinationPath spotify97-server-win64-${{ env.PACKAGE_VERSION }}-${{ env.SHA }}.zip;dir win;dir
working-directory: ./server/dist
- uses: actions/upload-artifact@v4
with:
name: windows-binary-${{ env.SHA }}
path: server/dist/spotify97-server-win64-${{ env.PACKAGE_VERSION }}-${{ env.SHA }}.zip
upload:
runs-on: ubuntu-latest
needs: "build"
steps:
- uses: actions/checkout@v4
- uses: jozsefsallai/node-package-version@v1.0.4
with:
path: server/package.json
- uses: benjlevesque/short-sha@v3.0
- uses: actions/download-artifact@v4
with:
name: windows-binary-${{ env.SHA }}
path: .
- run: ls -la
- name: upload
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
source: "spotify97-server-win64-${{env.PACKAGE_VERSION}}-${{ env.SHA }}.zip"
target: /srv/www/public/spotifyclient97/server/${{ env.PACKAGE_VERSION }}/${{ env.SHA }}/