-
Notifications
You must be signed in to change notification settings - Fork 56
110 lines (106 loc) · 3.58 KB
/
nexus.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
name: Nexus (Development)
on:
push:
branches:
- master
- develop
- 'release/**'
- 'hotfix/**'
jobs:
build:
name: Build and Deploy
runs-on: ubuntu-latest
container:
image: electronuserland/builder:18-wine
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
id: cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('package.json') }}
- name: Fix git perms issue
run: git config --global --add safe.directory /__w/launcher/launcher
- name: Install Dependencies
run: npm install
if: steps.cache.outputs.cache-hit != 'true'
env:
CI: true
- name: Build
env:
NODE_ENV: "production"
PACK_ARCH: "ia32"
PACK_PLATFORM: "win32"
run: npm run build
- name: Create wine prefix folder
run: mkdir /__w/launcher/launcher/wine
- name: Pack
env:
WINEPREFIX: "/__w/launcher/launcher/wine"
run: npm run nexusPack
- name: Generate Metadata
run: |
apt-get update
apt-get install libarchive-zip-perl p7zip-full jq -y
jq --null-input \
--arg name "Launcher" \
--arg desc "Launcher for browsing and running games" \
--arg date $(date +%s) \
--arg download $(du -b dist/Flashpoint.zip | awk '{print $1}') \
--arg install $(7z l dist/Flashpoint.zip | tail -n 1 | awk '{print $3}') \
--arg path "Launcher" \
--arg depends "core-logos core-credits core-database core-server-gamezip core-server-legacy" \
--arg hash $(crc32 dist/Flashpoint.zip) \
'{
"title": $name,
"description": $desc,
"date-modified": $date,
"download-size": $download,
"install-size": $install,
"path": $path,
"depends": $depends,
"crc32": $hash
}' > metadata.json
ls -la
cat metadata.json
- name: Deploy to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=core-launcher.zip
filename: dist/Flashpoint.zip
- name: Deploy Metadata to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=core-launcher.json
filename: metadata.json
- name: Generate components.xml
run: |
git clone https://gitlab.unstable.life/flashpoint/docker/nexus-deploy-action.git nexus
cd nexus
python3 ./merge-metadata.py "https://nexus-dev.unstable.life/service/rest/v1/search?repository=development&name=*.json" components.xml "https://nexus-dev.unstable.life/repository/development/"
- name: Deploy components.xml to Nexus
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: https://nexus-dev.unstable.life
username: github
password: ${{ secrets.NEXUS_PASSWORD }}
format: raw
repository: components
coordinates: directory=/
assets: filename=components.xml
filename: ./nexus/components.xml