-
-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (77 loc) · 2.85 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
name: Nexus Deployment
on:
push:
branches:
- main
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Build and Package Release
run: npm run package
- name: Generate Metadata
run: |
sudo apt install libarchive-zip-perl -y
jq --null-input \
--arg name "Analytics" \
--arg desc "Provides hardware and gameplay analytics to the Flashpoint Project" \
--arg date $(date +%s) \
--arg download $(du -b extension.fplx | awk '{print $1}') \
--arg install $(7z l extension.fplx | tail -n 1 | awk '{print $3}') \
--arg path "Data/Extensions" \
--arg hash $(crc32 extension.fplx) \
'{
"title": $name,
"description": $desc,
"date-modified": $date,
"download-size": $download,
"install-size": $install,
"path": $path,
"crc32": $hash
}' > metadata.json
- name: Deploy File 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=extension-analytics.zip
filename: extension.fplx
- 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=extension-analytics.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