Skip to content

build

build #31

Workflow file for this run

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