fix: trojan speed not shown #2397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Qv2ray Windows Installer | |
on: | |
push: | |
branches-ignore: | |
- l10n_dev | |
release: | |
types: [prereleased] | |
workflow_dispatch: | |
jobs: | |
check_commit_msg: | |
outputs: | |
commit_message: ${{ steps.get_message.outputs.message }} | |
name: Check if the workflow has been disabled. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get commit message | |
id: get_message | |
run: | | |
echo "::set-output name=message::$(git log --format=%B -n 1 ${{ github.event.after }} | tr '\n' ' ')" | |
echo "message=\"$(git log --format=%B -n 1 ${{ github.event.after }} | tr '\n' ' ')\"" >> $GITHUB_ENV | |
build: | |
needs: check_commit_msg | |
if: ${{ !contains( needs.check_commit_msg.outputs.commit_message, '!NSIS') }} | |
strategy: | |
matrix: | |
qt_version: [5.15.0] | |
platform: [windows-latest] | |
arch: [x64] | |
include: | |
- platform: windows-latest | |
arch: x64 | |
qtarch: win64_msvc2019_64 | |
fail-fast: false | |
runs-on: ${{ matrix.platform }} | |
env: | |
_QV2RAY_BUILD_INFO_: "Qv2ray built from Github Action" | |
_QV2RAY_BUILD_EXTRA_INFO_: "qt${{ matrix.qt_version }}-${{ github.sha }}-ci.${{ matrix.platform }}" | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
steps: | |
- name: Get the version | |
id: get_version | |
shell: bash | |
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) | |
- name: Checking out sources | |
uses: actions/checkout@v2 | |
with: | |
submodules: 'recursive' | |
- name: Install Python 3.7 version | |
uses: actions/setup-python@v1 | |
with: | |
python-version: "3.7" | |
architecture: ${{ matrix.arch }} | |
# ========================================================================================================= | |
- name: Install MSVC compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
# 14.1 is for vs2017, 14.2 is vs2019, following the upstream vcpkg build from Qv2ray-deps repo | |
toolset: 14.2 | |
arch: ${{ matrix.arch }} | |
- name: Cache Qt | |
id: cache-qt | |
uses: actions/cache@v1 | |
with: | |
path: ../Qt | |
key: QtCache-${{ matrix.platform }}-${{ matrix.arch }}-${{ matrix.qt_version }} | |
- name: Installing Qt - ${{ matrix.arch }} | |
uses: jurplel/install-qt-action@v2 | |
with: | |
version: ${{ matrix.qt_version }} | |
arch: ${{ matrix.qtarch }} | |
mirror: "http://mirrors.ocf.berkeley.edu/qt/" | |
cached: ${{ steps.cache-qt.outputs.cache-hit }} | |
# ========================================================================================================= | |
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Setup Ninja | |
uses: ashutoshvarma/setup-ninja@master | |
with: | |
# ninja version to download. Default: 1.10.0 | |
version: 1.10.0 | |
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Build preparation - Download Dependencies | |
shell: bash | |
run: | | |
cd libs | |
./setup-libs.sh windows ${{ matrix.arch }} | |
# ========================================================================================================= Generate MakeFile and Build | |
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Generate Dependencies and Build | |
shell: bash | |
env: | |
CC: cl.exe | |
CXX: cl.exe | |
run: | | |
mkdir build | |
cd build | |
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_NSIS=ON | |
cmake --build . --target package --parallel $(nproc) | |
- name: Windows - Get package name | |
shell: bash | |
id: get_package | |
run: | | |
echo ::set-output name=NAME::$(basename build/qv2ray-*.exe) | |
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - uploading artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: Qv2ray-${{ github.sha }}.Windows-${{ matrix.arch }}.qt${{ matrix.qt_version }}.exe | |
path: build/${{ steps.get_package.outputs.NAME }} | |
- name: Win-${{ matrix.arch }} - ${{ matrix.qt_version }} - Upload binaries to release | |
uses: svenstaro/upload-release-action@v1-release | |
if: github.event_name == 'release' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: build/${{ steps.get_package.outputs.NAME }} | |
asset_name: ${{ steps.get_package.outputs.NAME }} | |
tag: ${{ github.ref }} | |
overwrite: true |