1
mirror of https://github.com/R2Northstar/Northstar synced 2025-09-21 00:50:50 +02:00

Compare commits

...

9 Commits

Author SHA1 Message Date
GeckoEidechse
956839c4e2 build: Use release subdir for packaging release
To avoid accidentally bundling unwanted files etc
2023-11-02 16:53:21 +01:00
GeckoEidechse
de87f41b45 Delete bash scripts in project root as well (#578)
Delete bash scripts in project root as well to prevent wait script from being included in release files
2023-11-02 13:32:13 +01:00
GeckoEidechse
d6d2dfe47d Use dl link instead of release page in wait script
Use the download link instead of the release link in wait script as
release link becomes valid on tag creation before download is ready.
2023-11-02 13:09:38 +01:00
GeckoEidechse
c829a40caa Pass missing version number to wait script 2023-11-02 12:49:34 +01:00
GeckoEidechse
a11a37e710 Checkout repo files as first step (#577)
Checkout the files from this repo first in order to have the bash
script ready that is needed to block launcher files download.
2023-11-02 12:14:51 +01:00
GeckoEidechse
72e8e50d77 Fix bash script file name
I changed the filename but forgot to update it in the CI config
2023-11-02 12:02:09 +01:00
GeckoEidechse
8fb1f315bb Add step to wait for launcher files to be ready (#576)
Adds a small bash script and calls it in CI to block the CI from progressing until the launcher release files are uploaded.
2023-11-02 11:51:52 +01:00
GeckoEidechse
4dccb376ec Trim trailing whitespaces 2023-10-30 21:05:31 +01:00
Jack
ec0491e1e3 Make add-to-project work on PRs (#574) 2023-10-29 00:01:55 +02:00
3 changed files with 52 additions and 21 deletions

View File

@@ -4,6 +4,9 @@ on:
issues: issues:
types: types:
- opened - opened
pull_request_target:
types:
- opened
jobs: jobs:
add-to-project: add-to-project:

View File

@@ -20,6 +20,15 @@ jobs:
build-northstar: build-northstar:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout release files
uses: actions/checkout@v3
with:
ref: ${{ env.NORTHSTAR_VERSION }}
path: northstar
- name: Wait for launcher release build to be ready
timeout-minutes: 30 # Only wait for 30 minutes. If we take longer, something probably broke
run:
bash northstar/wait_for_launcher_dl.sh $NORTHSTAR_VERSION
- name: Download compiled launcher - name: Download compiled launcher
run: run:
wget "https://github.com/R2Northstar/NorthstarLauncher/releases/download/${{ env.NORTHSTAR_VERSION }}/northstar-launcher.zip" wget "https://github.com/R2Northstar/NorthstarLauncher/releases/download/${{ env.NORTHSTAR_VERSION }}/northstar-launcher.zip"
@@ -29,11 +38,6 @@ jobs:
- name: Download compiled stubs - name: Download compiled stubs
run: run:
wget "https://github.com/R2Northstar/NorthstarStubs/releases/download/v1/NorthstarStubs.zip" wget "https://github.com/R2Northstar/NorthstarStubs/releases/download/v1/NorthstarStubs.zip"
- name: Checkout release files
uses: actions/checkout@v3
with:
ref: ${{ env.NORTHSTAR_VERSION }}
path: northstar
- name: Checkout core mods - name: Checkout core mods
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@@ -53,17 +57,15 @@ jobs:
git ls-tree -r $NORTHSTAR_VERSION --name-only | xargs -L1 md5sum >> md5sum.txt git ls-tree -r $NORTHSTAR_VERSION --name-only | xargs -L1 md5sum >> md5sum.txt
- name: Make folder structure - name: Make folder structure
run: | run: |
mv -v northstar/release/* northstar/. mkdir -p northstar/release/R2Northstar/mods
rm -d northstar/release mkdir -p northstar/release/R2Northstar/plugins
mkdir -p northstar/R2Northstar/mods mkdir -p northstar/release/bin/x64_dedi
mkdir -p northstar/R2Northstar/plugins
mkdir -p northstar/bin/x64_dedi
unzip northstar-discord-rpc.zip -d northstar/R2Northstar/plugins unzip northstar-discord-rpc.zip -d northstar/release/R2Northstar/plugins
unzip NorthstarStubs.zip -d northstar/bin/x64_dedi unzip NorthstarStubs.zip -d northstar/release/bin/x64_dedi
unzip northstar-launcher.zip -d northstar unzip northstar-launcher.zip -d northstar
rsync -avr --exclude="Northstar.Coop" --exclude=".git*" northstar-mods/. northstar/R2Northstar/mods rsync -avr --exclude="Northstar.Coop" --exclude=".git*" northstar-mods/. northstar/release/R2Northstar/mods
- name: Checkout Navmesh repository - name: Checkout Navmesh repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
@@ -72,13 +74,13 @@ jobs:
path: northstar-navs path: northstar-navs
- name: Navmeshes setup - name: Navmeshes setup
run: | run: |
mkdir -p northstar/R2Northstar/mods/Northstar.CustomServers/mod/maps mkdir -p northstar/release/R2Northstar/mods/Northstar.CustomServers/mod/maps
mv -v northstar-navs/graphs northstar/R2Northstar/mods/Northstar.CustomServers/mod/maps mv -v northstar-navs/graphs northstar/release/R2Northstar/mods/Northstar.CustomServers/mod/maps
mv -v northstar-navs/navmesh northstar/R2Northstar/mods/Northstar.CustomServers/mod/maps mv -v northstar-navs/navmesh northstar/release/R2Northstar/mods/Northstar.CustomServers/mod/maps
- name: Cleanup root Northstar repository files - name: Cleanup root Northstar repository files
working-directory: northstar working-directory: northstar
run: | run: |
rm -rf .git .github .gitignore *.md LICENSE thunderstore .ci.env.example rm -rf .git .github .gitignore *.md LICENSE thunderstore .ci.env.example *.sh
- name: Upload - name: Upload
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@@ -86,7 +88,7 @@ jobs:
path: northstar path: northstar
- name: Create zip to upload - name: Create zip to upload
run: | run: |
cd northstar/ cd northstar/release/
zip --recurse-paths --quiet Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip . zip --recurse-paths --quiet Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip .
mv Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip ../ mv Northstar.release.${{ env.NORTHSTAR_VERSION }}.zip ../
- name: Compute SHA-512 checksum - name: Compute SHA-512 checksum
@@ -138,7 +140,7 @@ jobs:
- name: Make package structure - name: Make package structure
run: | run: |
mkdir -p thunderstore/dist/Northstar mkdir -p thunderstore/dist/Northstar
mv -v northstar/* thunderstore/dist/Northstar mv -v northstar/release/* thunderstore/dist/Northstar
wget -O thunderstore/icon.png https://raw.githubusercontent.com/R2Northstar/Northstar/main/thunderstore/icon.png wget -O thunderstore/icon.png https://raw.githubusercontent.com/R2Northstar/Northstar/main/thunderstore/icon.png
wget -O thunderstore/README.md https://raw.githubusercontent.com/R2Northstar/Northstar/main/thunderstore/README.md wget -O thunderstore/README.md https://raw.githubusercontent.com/R2Northstar/Northstar/main/thunderstore/README.md

26
wait_for_launcher_dl.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Check if contains command line arg
if [ -z "$1" ]; then
echo "Missing command-line argument."
exit 1
fi
url="https://github.com/R2Northstar/NorthstarLauncher/releases/download/$1/northstar-launcher.zip"
wait_time_seconds=60
# Loop until the response code changes
while true; do
response=$(curl --silent --output /dev/null --write-out "%{http_code}" $url)
if [ $response -eq 404 ]; then
echo "Response is 404. Retrying in $wait_time_seconds seconds."
sleep $wait_time_seconds
else
echo "Site is accessible with response code $response."
break
fi
done
# 10 second sleep just in case we hit some weird race condition
# where files are still being uploaded but release is done
sleep 10