-
Notifications
You must be signed in to change notification settings - Fork 20
77 lines (73 loc) · 3.24 KB
/
build.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
name: build
on:
release:
types: [published]
env:
NORTHSTAR_VERSION: ${{ github.event.release.tag_name }}
jobs:
build-northstarcn:
runs-on: ubuntu-latest
steps:
- name: Checkout binary
uses: actions/checkout@v2
with:
repository: R2NorthstarCN/NorthstarCN_Binaries
ref: "main" # ${{ env.NORTHSTAR_VERSION }}
path: northstar-launcher
- name: Download compiled stubs
run:
wget "https://github.com/R2Northstar/NorthstarStubs/releases/download/v1/NorthstarStubs.zip"
- name: Checkout core mods
uses: actions/checkout@v2
with:
repository: R2NorthstarCN/NorthstarMods
ref: "main" # ${{ env.NORTHSTAR_VERSION }}
path: northstar-mods
- name: Update mod version info
run: |
export MOD_VERSION=$(echo $NORTHSTAR_VERSION | awk '{match($0,/[0-9]+\.[0-9]+\.[0-9]+/,a);print a[0]}')
cat <<< $(jq ".Version = \"${MOD_VERSION}\"" northstar-mods/Northstar.Client/mod.json) > northstar-mods/Northstar.Client/mod.json
cat <<< $(jq ".Version = \"${MOD_VERSION}\"" northstar-mods/Northstar.Custom/mod.json) > northstar-mods/Northstar.Custom/mod.json
cat <<< $(jq ".Version = \"${MOD_VERSION}\"" northstar-mods/Northstar.CustomServers/mod.json) > northstar-mods/Northstar.CustomServers/mod.json
- name: Make folder structure
run: |
mkdir -p northstar/R2Northstar/mods
mkdir -p northstar/R2Northstar/plugins
mkdir -p northstar/bin/x64_retail
mv -v northstar-launcher/placeholder_playerdata.pdata northstar/R2Northstar
mv -v northstar-launcher/wsock32.dll northstar/bin/x64_retail
unzip NorthstarStubs.zip -d northstar/bin/x64_dedi
mv -v northstar-launcher/* northstar
rsync -avr --exclude="Northstar.Coop" --exclude=".git*" northstar-mods/. northstar/R2Northstar/mods
- name: Checkout Navmesh repository
uses: actions/checkout@v2
with:
repository: R2Northstar/NorthstarNavs
path: northstar-navs
- name: Navmeshes setup
run: |
mkdir -p northstar/R2Northstar/mods/Northstar.CustomServers/mod/maps
mv -v northstar-navs/graphs northstar/R2Northstar/mods/Northstar.CustomServers/mod/maps
mv -v northstar-navs/navmesh northstar/R2Northstar/mods/Northstar.CustomServers/mod/maps
- name: Cleanup Northstar repository files
working-directory: northstar
run: |
rm -rf .git .github .gitignore *.md LICENSE thunderstore .ci.env.example
rm -rf R2Northstar/mods/LICENSE R2Northstar/mods/*.md
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Northstar.release.${{ env.NORTHSTAR_VERSION }}
path: northstar
- name: Create ZIP
run: |
cd northstar ; zip -r ../northstar.zip . * ; cd ..
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./northstar.zip
asset_name: ${{ env.NORTHSTAR_VERSION }}.zip
asset_content_type: application/zip