Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide automatic pre-releases via GitHub Actions and fix deps build script for ARM64 #1024

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Release

on:
push:
branches:
- develop
- master

jobs:
build:
runs-on: windows-latest
continue-on-error: ${{ matrix.arch != 'x86' }}

strategy:
fail-fast: false
matrix:
arch:
- x86
- x64
- arm64

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2

- name: Build dependencies
run: deps\build.bat --machine ${{matrix.arch}}

- name: Put git commit hash in version value
run: |
(
Get-Content -Path src\taiga\config.h
) -Replace (
"(?<=#define TAIGA_VERSION_BUILD 0x).*",
(git rev-parse --short HEAD)
) | Set-Content -Path src\taiga\config.h

- name: Build Taiga
run: msbuild "project\vs2022\Taiga.sln" /m /p:Configuration=Release /p:Platform=${{matrix.arch}}

- name: Build installer
run: makensis /DMACHINE=${{matrix.arch}} "setup\Taiga.nsi"

- name: Rename installer executable
run: mv bin/${{matrix.arch}}/TaigaSetup.exe bin/${{matrix.arch}}/TaigaSetup_${{matrix.arch}}.exe

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: TaigaSetup_${{matrix.arch}}
path: bin/${{matrix.arch}}/TaigaSetup_${{matrix.arch}}.exe

publish:
runs-on: ubuntu-latest
needs: build

steps:
- name: Download artifacts
uses: actions/download-artifact@v4

- name: Publish release
uses: marvinpinto/[email protected]
with:
repo_token: "${{secrets.GITHUB_TOKEN}}"
automatic_release_tag: latest
prerelease: true
files: TaigaSetup_*/TaigaSetup_*.exe
27 changes: 16 additions & 11 deletions deps/build.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@echo off

set machine=x86
set vctarget=x86
set vc=16

:read_arguments
if "%1"=="--help" goto help
if "%1"=="--machine" set machine=%2
if "%1"=="--machine" set vctarget=%2
if "%1"=="--vc" set vc=%2
shift /1
shift /1
Expand All @@ -15,7 +15,7 @@ goto locate_vs
:help
echo Usage: %~nx0 [--machine] [--vc]
echo:
echo --machine Target architecture, such as "x86", "x64" or "x64_arm64".
echo --machine Target architecture, such as "x86", "x64" or "arm64".
echo --vc Can be "16" ^(VS2019^). Overriden by vswhere, if available.
echo:
echo Example: %~nx0 --machine=x86 --vc=16
Expand All @@ -35,7 +35,12 @@ if exist %vswhere% (

:initialize_environment
echo Initializing environment...
call %vcvarsall% %machine% || (
set vchost=%PROCESSOR_ARCHITECTURE%
if /I %vchost%==amd64 set vchost=x64
if /I %vctarget%==amd64 set vctarget=x64
set vcarch=%vctarget%
if /I not %vchost%==%vcarch% set vcarch=%vchost%_%vcarch%
call %vcvarsall% %vcarch% || (
echo Please edit the build script according to your system configuration.
exit /B 1
)
Expand All @@ -50,18 +55,18 @@ call src\curl\buildconf.bat

if exist src\curl\builds (
echo Clearing previous libcurl builds...
for /d %%G in ("src\curl\builds\libcurl-vc%vc%-%machine%-*") do (rmdir /s /q "%%~G")
for /d %%G in ("src\curl\builds\libcurl-vc%vc%-%vctarget%-*") do (rmdir /s /q "%%~G")
)

cd src\curl\winbuild\

echo Building libcurl for Debug^|%machine% configuration...
nmake /f Makefile.vc mode=static RTLIBCFG=static VC=%vc% MACHINE=%machine% DEBUG=yes
xcopy /s ..\builds\libcurl-vc%vc%-%machine%-debug-static-ipv6-sspi-schannel\lib ..\..\..\lib\%machine%\
echo Building libcurl for Debug^|%vctarget% configuration...
nmake /f Makefile.vc mode=static RTLIBCFG=static VC=%vc% MACHINE=%vctarget% DEBUG=yes
xcopy /s ..\builds\libcurl-vc%vc%-%vctarget%-debug-static-ipv6-sspi-schannel\lib ..\..\..\lib\%vctarget%\

echo Building libcurl for Release^|%machine% configuration...
nmake /f Makefile.vc mode=static RTLIBCFG=static VC=%vc% MACHINE=%machine%
xcopy /s ..\builds\libcurl-vc%vc%-%machine%-release-static-ipv6-sspi-schannel\lib ..\..\..\lib\%machine%\
echo Building libcurl for Release^|%vctarget% configuration...
nmake /f Makefile.vc mode=static RTLIBCFG=static VC=%vc% MACHINE=%vctarget%
xcopy /s ..\builds\libcurl-vc%vc%-%vctarget%-release-static-ipv6-sspi-schannel\lib ..\..\..\lib\%vctarget%\

cd /D %currentdir%

Expand Down
2 changes: 1 addition & 1 deletion src/taiga/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#define TAIGA_VERSION_MINOR 4
#define TAIGA_VERSION_PATCH 1
#define TAIGA_VERSION_PRE ""
#define TAIGA_VERSION_BUILD 0
#define TAIGA_VERSION_BUILD 0x0

// Used in version.rc
#define TAIGA_VERSION_DIGITAL \
Expand Down
4 changes: 3 additions & 1 deletion src/taiga/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <fmt/format.h>

#include "taiga/version.h"

#include "base/preprocessor.h"
Expand All @@ -29,7 +31,7 @@ const semaver::Version& version() {
TAIGA_VERSION_MINOR,
TAIGA_VERSION_PATCH,
TAIGA_VERSION_PRE,
TAIGA_VERSION_BUILD > 0 ? STRINGIZE(TAIGA_VERSION_BUILD) : ""
TAIGA_VERSION_BUILD == 0 ? "" : fmt::format("{:x}", TAIGA_VERSION_BUILD)
);
return version;
}
Expand Down