Skip to content

Commit

Permalink
fix: fixed the problem that cats cannot be touched.
Browse files Browse the repository at this point in the history
  • Loading branch information
epicbigcat authored Nov 23, 2024
1 parent aa4f5fa commit bd579e3
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 36 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
mode: [release, debug]
runs-on: ubuntu-22.04 # for compatibility.
runs-on: ubuntu-20.04 # for compatibility.
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -30,22 +30,18 @@ jobs:
restore-keys: |
xmake-linux-${{ matrix.mode }}-
- name: Install build toolchains
run: |
sudo apt install -y build-essential
- name: Sync with repository
run: |
xmake repo -u
- name: Build for host
run: |
xmake f -a x64 -m ${{ matrix.mode }} -p linux -v -y
xmake f -a x86_64 -m ${{ matrix.mode }} -p linux -v -y
xmake -v -y
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: allay-launcher-linux-x64-${{ matrix.mode }}
name: allay-launcher-linux-x86_64-${{ matrix.mode }}
path: |
build/linux/x64/${{ matrix.mode }}
build/linux/x86_64/${{ matrix.mode }}
35 changes: 22 additions & 13 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,51 @@ name: Build (Windows)

on:
push:
branches: [ "*" ]
paths:
- .github/workflows/build-windows.yml
- src/**
- xmake.lua

jobs:
build:
strategy:
matrix:
mode:
- release
- debug
mode: [release, debug]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- uses: xmake-io/github-action-setup-xmake@v1
- name: Setup XMake
uses: xmake-io/github-action-setup-xmake@v1

- uses: actions/cache@v4
- name: Restore xmake cache
uses: actions/cache@v4
with:
path: |
~/AppData/Local/.xmake
key: xmake-windows-${{ hashFiles('xmake.lua') }}
restore-keys: |
xmake-windows-
- uses: microsoft/setup-msbuild@v2
- name: Setup MSVC
uses: microsoft/setup-msbuild@v2

- run: |
- name: Sync with repository
run: |
xmake repo -u
- run: |
- name: Configure
run: |
xmake f -a x64 -m ${{ matrix.mode }} -p windows -v -y
- run: |
- name: Build
run: |
xmake -v -y
- uses: actions/upload-artifact@v4
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: allay-launcher-windows-x64-${{ matrix.mode }}
path: |
build/windows/x64/${{ matrix.mode }}
build/windows/x64/${{ matrix.mode }}
14 changes: 0 additions & 14 deletions src/util/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,4 @@ std::string environment(std::string_view var) {
return val ? std::string{val} : std::string{};
}

std::optional<SystemProxy> system_proxy_configuration() {
static const std::vector<std::string> vars{"https_proxy", "HTTPS_PROXY", "http_proxy", "HTTP_PROXY"};

for (auto& var : vars) {
if (auto env = environment(var); !env.empty()) {
SystemProxy config;
config.m_server = env;
return config;
}
}

return {};
}

} // namespace allay_launcher::util::os
19 changes: 19 additions & 0 deletions src/util/os_linux.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "util/os.h"

namespace allay_launcher::util::os {

std::optional<SystemProxy> system_proxy_configuration() {
static const std::vector<std::string> vars{"https_proxy", "HTTPS_PROXY", "http_proxy", "HTTP_PROXY"};

for (auto& var : vars) {
if (auto env = environment(var); !env.empty()) {
SystemProxy config;
config.m_server = env;
return config;
}
}

return {};
}

} // namespace allay_launcher::util::os
4 changes: 3 additions & 1 deletion xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ add_rules('mode.debug', 'mode.release')

add_repositories('allaymc-repo https://github.com/AllayMC/xmake-repo.git')

add_requires('openssl', {system = true})

add_requires('argparse 3.1')
add_requires('spdlog 1.14.1')
add_requires('nlohmann_json 3.11.3')
Expand Down Expand Up @@ -40,4 +42,4 @@ target('allay')

if is_mode('debug') then
add_defines('DEBUG')
end
end

0 comments on commit bd579e3

Please sign in to comment.