Compare commits

...

9 commits

Author SHA1 Message Date
larzie
461c30f572
Merge d86830028e into 280b6efa94 2024-11-14 15:46:51 +11:00
Fleeym
280b6efa94
fix: fix mod downloads not checking version (#1148)
Some checks are pending
Build Binaries / Build Windows (push) Waiting to run
Build Binaries / Build macOS (push) Waiting to run
Build Binaries / Build Android (64-bit) (push) Waiting to run
Build Binaries / Build Android (32-bit) (push) Waiting to run
Build Binaries / Publish (push) Blocked by required conditions
2024-11-14 02:26:40 +02:00
larzie
d86830028e
My bad :p 2024-11-08 16:55:41 +03:00
larzie
179c3033ba
Update build debug info action 2024-11-08 14:19:10 +03:00
larzie
8903fa0dff
Update build debug info post action 2024-11-08 13:10:46 +03:00
larzie
ba601d8855
Update site build CI 2024-11-07 16:12:46 +03:00
larzie
23138cfc99
Update draft release action 2024-11-07 16:11:40 +03:00
larzie
9660667888
Update changelog checker 2024-11-07 16:07:12 +03:00
larzie
e4049f4b81
Update build CI 2024-11-07 16:04:39 +03:00
11 changed files with 323 additions and 298 deletions

View file

@ -1,4 +1,4 @@
name: Prepare for Build Debug Info
name: Prepare for Build Debug Info
description: Provides debug info for the build process
inputs:
@ -16,7 +16,15 @@ runs:
cd build
sed 's/\\\\/\//g' compile_commands.json | sed 's/D:\//\/d\//' > uni_compile_commands.json
pip install compile-commands --break-system-packages
compile-commands --file=uni_compile_commands.json --filter_files='.*info\.rc.*' --filter='(.*) -o (.*)((?:/|\\).*)\.(?:obj|o) -c (.*)' --replacement="$BASH"' --noprofile --norc -c "mkdir -p ../build-debug-info-preprocessed/\g<2> && \g<1> -o ../build-debug-info-preprocessed/\g<2>\g<3>.i -E \g<4>"' -o ../build-debug-info/preprocess_commands.json --run --verbose
compile-commands --file=uni_compile_commands.json \
--filter_files='.*info\.rc.*' \
--filter='(.*) -o (.*)((?:/|\\).*)\.(?:obj|o) -c (.*)' \
--replacement="$BASH" \
--noprofile --norc -c "\
mkdir -p ../build-debug-info-preprocessed/\g<2> && \
\g<1> -o ../build-debug-info-preprocessed/\g<2>\g<3>.i -E \g<4>"' \
-o ../build-debug-info/preprocess_commands.json \
--run --verbose
- name: Upload Build Debug Info
uses: actions/upload-artifact@v4

View file

@ -1,16 +1,18 @@
name: Prepare for Build Debug Info
name: Prepare for Build Debug Info
description: Provides debug info for the build process
inputs:
has-sccache:
description: 'Whether the build action has sccache'
required: true
outputs:
extra-configure:
description: 'Extra stuff for CMake configure step'
value: |
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cp ./build/compile_commands.json ./build-debug-info/
extra-build:
description: 'Extra stuff for CMake build step'
value: |
@ -28,7 +30,7 @@ runs:
echo "SCCACHE_LOG=debug" >> $GITHUB_ENV
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
- name: Checkout ninjatracing
- name: Checkout ninjatracing repository
uses: actions/checkout@v4
with:
repository: 'nico/ninjatracing'

View file

@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
@ -64,7 +64,7 @@ jobs:
uses: geode-sdk/cli/.github/actions/setup@main
- name: Download xwin
uses: robinraju/release-downloader@v1.10
uses: robinraju/release-downloader@v1
with:
repository: Jake-Shadle/xwin
latest: true
@ -79,8 +79,6 @@ jobs:
mv epic-xwin/xwin-*-x86_64-unknown-linux-musl/xwin ./xwin
./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license list
# this caches '.xwin-cache/**/*' but that's actually only gonna
# contain the manifest cuz we only ran `xwin list` so far
- name: Setup xwin Cache
id: xwin-cache
uses: actions/cache@v4
@ -111,18 +109,18 @@ jobs:
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
- name: Upload Artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: geode-win
path: ./bin/nightly
- name: Package Installer
- name: Package installer
run: |
sudo apt install nsis
makensis -WX -V3 ./installer/windows/installer.nsi
- name: Upload Installer
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: geode-installer-win
@ -142,7 +140,7 @@ jobs:
SCCACHE_CACHE_MULTIARCH: 1
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
@ -154,8 +152,7 @@ jobs:
has-sccache: ${{ inputs.use-ccache }}
if: inputs.build-debug-info
# due to very strange performance issues, sccache is currently disabled for macos. sorry
# macOS does not currently support sccache due to performance issues
# - name: Setup caches
# uses: ./.github/actions/setup-cache
# with:
@ -186,16 +183,16 @@ jobs:
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
- name: Upload Artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: geode-mac
path: ./bin/nightly
- name: Package Installer
- name: Package installer
run: ./installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg
- name: Upload Installer
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: geode-installer-mac
@ -215,7 +212,6 @@ jobs:
- name: Android (32-bit)
id: android32
extra-configure: -DANDROID_ABI=armeabi-v7a
- name: Android (64-bit)
id: android64
extra-configure: -DANDROID_ABI=arm64-v8a
@ -224,7 +220,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
@ -277,13 +273,12 @@ jobs:
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
# hardcoding toolchain path :(
- name: Dump Symbols
- name: Dump symbols
run: |
${{ steps.breakpad-tools.outputs.binary-path }} ./bin/nightly/Geode.${{ matrix.config.id }}.so -o ./bin/nightly/Geode.${{ matrix.config.id }}.so.sym
$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip ./bin/nightly/Geode.${{ matrix.config.id }}.so
- name: Upload Artifacts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: geode-${{ matrix.config.id }}
@ -300,55 +295,56 @@ jobs:
runs-on: ubuntu-latest
needs: [ build-windows, build-mac, build-android ]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
- name: Declare Version Variables
- name: Declare version variables
id: ref
run: |
echo "version=$(cat VERSION | xargs)" >> $GITHUB_OUTPUT
echo "hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
- name: Download Artifacts
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Move Installers
- name: Move installers
run: |
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
- name: Zip MacOS Artifacts
- name: Zip MacOS artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
dest: geode-${{ steps.ref.outputs.hash }}-mac.zip
- name: Zip Windows Artifacts
- name: Zip Windows artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
dest: geode-${{ steps.ref.outputs.hash }}-win.zip
- name: Zip Android32 Artifacts
- name: Zip Android32 artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-android32/Geode.android32.so geode-android32/Geode.android32.so.sym
dest: geode-${{ steps.ref.outputs.hash }}-android32.zip
- name: Zip Android64 Artifacts
- name: Zip Android64 artifacts
uses: vimtor/action-zip@v1.2
with:
files: geode-android64/Geode.android64.so geode-android64/Geode.android64.so.sym
dest: geode-${{ steps.ref.outputs.hash }}-android64.zip
- name: Zip Resources
- name: Zip resources
uses: vimtor/action-zip@v1.2
with:
files: geode-android64/resources
dest: resources.zip
- name: Update Development Release
- name: Update development release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,5 +1,4 @@
# check the changelog for non ascii characters
name: Check CHANGELOG.md
name: Check Changelog
on:
push:
@ -11,16 +10,19 @@ on:
jobs:
check:
name: Check CHANGELOG.md
name: Check Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- run: |
if grep -q -P -n "[\x80-\xFF]" CHANGELOG.md
then
exit 1;
- name: Check for non-ASCII characters in changelog
run: |
if grep -q -P -n "[\x80-\xFF]" CHANGELOG.md; then
echo "Non-ASCII characters found in CHANGELOG.md"
exit 1
else
echo "No non-ASCII characters found in CHANGELOG.md"
fi

View file

@ -7,9 +7,10 @@ jobs:
draft:
name: Draft Release
runs-on: ubuntu-latest
steps:
- name: Download Development Release
uses: robinraju/release-downloader@v1.9
- name: Download development release
uses: robinraju/release-downloader@v1
with:
tag: nightly
fileName: '*'
@ -17,14 +18,14 @@ jobs:
zipBall: true
out-file-path: 'dev'
- name: Declare Version Variable
- name: Declare version variable
id: ref
shell: bash
run: |
VERSION=$(unzip -p ${{ github.workspace }}/dev/geode-nightly.zip geode-sdk-geode-*/VERSION | xargs)
echo "version=$VERSION" >> $GITHUB_OUTPUT
# test if release already exists
# Test if release already exists
set +e
curl --fail "https://api.github.com/repos/geode-sdk/geode/releases/tags/v$VERSION" --silent --output /dev/null
RESULT=$?
@ -35,7 +36,7 @@ jobs:
exit 1
fi
- name: Move Files
- name: Move files
run: |
mv dev/geode-installer-*-win.exe geode-installer-v${{ steps.ref.outputs.version }}-win.exe
mv dev/geode-installer-*-mac.pkg geode-installer-v${{ steps.ref.outputs.version }}-mac.pkg
@ -45,8 +46,8 @@ jobs:
mv dev/geode-*-android64.zip geode-v${{ steps.ref.outputs.version }}-android64.zip
mv dev/resources.zip resources.zip
- name: Create Draft Release
uses: softprops/action-gh-release@v1
- name: Create draft release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@ -54,9 +55,9 @@ jobs:
name: Geode v${{ steps.ref.outputs.version }}
body: |
TODO before publishing:
- mark if pre-release
- add changelog
- remove this
- Mark if pre-release
- Add changelog
- Remove this
draft: true
files: |
./geode-installer-v${{ steps.ref.outputs.version }}-win.exe

View file

@ -1,20 +1,16 @@
# Update the install page on the geode-sdk/website repository
name: Update Website
on:
# # trigger when a new release is released
# release:
# types:
# - released
workflow_dispatch:
jobs:
trigger:
name: Trigger site build
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
- name: Trigger build workflow on geode-sdk/website repository
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GEODE_BOT_PUSH_BIN_TOKEN }}
script: |

View file

@ -8,6 +8,7 @@
#include <fmt/chrono.h>
#include <loader/LoaderImpl.hpp>
#include "../internal/about.hpp"
#include "Geode/loader/Loader.hpp"
using namespace server;
@ -647,7 +648,7 @@ ServerRequest<ServerModVersion> server::getModVersion(std::string const& id, Mod
},
}, version);
return req.get(formatServerURL("/mods/{}/versions/{}", id, versionURL)).map(
return req.get(formatServerURL("/mods/{}/versions/{}?gd={}", id, versionURL, Loader::get()->getGameVersion())).map(
[](web::WebResponse* response) -> Result<ServerModVersion, ServerError> {
if (response->ok()) {
// Parse payload

View file

@ -8,6 +8,7 @@
#include <Geode/utils/ColorProvider.hpp>
#include <Geode/binding/ButtonSprite.hpp>
#include <Geode/loader/Loader.hpp>
#include "server/DownloadManager.hpp"
#include "ui/mods/GeodeStyle.hpp"
#include "ui/mods/popups/ModPopup.hpp"
#include "ui/mods/popups/DevPopup.hpp"
@ -631,18 +632,7 @@ void ModItem::onEnable(CCObject*) {
UpdateModListStateEvent(UpdateModState(m_source.getID())).post();
}
void ModItem::onInstall(CCObject*) {
if (auto updates = m_source.hasUpdates()) {
if (updates->replacement.has_value()) {
server::ModDownloadManager::get()->startDownload(
updates->replacement->id,
updates->replacement->version,
std::nullopt,
m_source.getID()
);
return;
}
}
server::ModDownloadManager::get()->startDownload(m_source.getID(), std::nullopt);
m_source.startInstall();
}
void ModItem::onDevelopers(CCObject*) {
DevListPopup::create(m_source)->show();

View file

@ -7,11 +7,13 @@
#include <Geode/loader/ModSettingsManager.hpp>
#include <Geode/ui/GeodeUI.hpp>
#include <Geode/utils/ColorProvider.hpp>
#include <optional>
#include "ConfirmUninstallPopup.hpp"
#include "../settings/ModSettingsPopup.hpp"
#include "../../../internal/about.hpp"
#include "../../GeodeUIEvent.hpp"
#include "../popups/ModtoberPopup.hpp"
#include "server/DownloadManager.hpp"
class FetchTextArea : public CCNode {
public:
@ -1047,7 +1049,9 @@ void ModPopup::onInstall(CCObject*) {
return;
}
}
server::ModDownloadManager::get()->startDownload(m_source.getID(), std::nullopt);
m_source.startInstall();
this->onClose(nullptr);
}

View file

@ -240,3 +240,27 @@ server::ServerRequest<std::optional<server::ServerModUpdate>> ModSource::checkUp
},
}, m_value);
}
void ModSource::startInstall() {
if (auto updates = this->hasUpdates()) {
if (updates->replacement.has_value()) {
server::ModDownloadManager::get()->startDownload(
updates->replacement->id,
updates->replacement->version,
std::nullopt,
this->getID()
);
} else {
server::ModDownloadManager::get()->startDownload(
this->getID(),
updates->version
);
}
} else {
server::ModDownloadManager::get()->startDownload(
this->getID(),
this->asServer()
? std::optional{this->asServer()->latestVersion().getVersion()}
: std::nullopt
);
}
}

View file

@ -49,4 +49,5 @@ public:
server::ServerRequest<std::optional<std::string>> fetchChangelog() const;
server::ServerRequest<std::unordered_set<std::string>> fetchValidTags() const;
server::ServerRequest<std::optional<server::ServerModUpdate>> checkUpdates();
void startInstall();
};