Skip to content

Commit

Permalink
Build ScyllaHide with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed Oct 27, 2021
1 parent 2b407b3 commit 42526a0
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Visual Studio

on: [push, pull_request]

jobs:
build:
# Skip building pull requests from the same repository
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build
run: |
cmd /c call release.bat
- name: Get current time
uses: srfrnk/current-time@v1.1.0
id: current-time
with:
format: YYYY-MM-DD_HH-MM

- uses: actions/upload-artifact@v2
with:
name: ${{ github.event.repository.name }}_${{ steps.current-time.outputs.formattedTime }}
path: Release/

- name: Compress artifacts
uses: papeloto/action-zip@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: Release/
dest: ${{ github.event.repository.name }}_${{ steps.current-time.outputs.formattedTime }}.zip

- name: Release
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') || contains(github.ref, '-pre') }}
files: ${{ github.event.repository.name }}_${{ steps.current-time.outputs.formattedTime }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 8 additions & 2 deletions SCMRevGen/make_scmrev.h.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ set GIT_VERSION_NUMBER=0
set GIT_SHORT_HASH=unknown

where git 1>nul 2>&1
if errorlevel 1 goto :nogit
if errorlevel 1 goto :nogit

echo fuck:
git rev-list --count HEAD

for /f "usebackq delims=" %%i in (`git rev-list --count HEAD`) do (
set GIT_VERSION_NUMBER=%%i
Expand All @@ -22,7 +25,8 @@ set COMPILE_YEAR=
for /f "usebackq delims=" %%i in (`date.exe +^"%%Y^"`) do (
set COMPILE_YEAR=%%i
)


echo Creating scmrev.h %GIT_SHORT_HASH%
echo #pragma once> scmrev.h
echo.>> scmrev.h
echo #define GIT_VERSION_NUMBER %GIT_VERSION_NUMBER%>> scmrev.h
Expand All @@ -32,3 +36,5 @@ echo #define COMPILE_DATE_A "%COMPILE_DATE%">> scmrev.h
echo #define COMPILE_DATE_W L"%COMPILE_DATE%">> scmrev.h
echo #define COMPILE_YEAR_A "%COMPILE_YEAR%">> scmrev.h
echo #define COMPILE_YEAR_W L"%COMPILE_YEAR%">> scmrev.h

type scmrev.h
5 changes: 5 additions & 0 deletions Scylla/Scylla.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<ClInclude Include="Version.h" />
<ClInclude Include="Win32kSyscalls.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SCMRevGen\SCMRevGen.vcxproj">
<Project>{4cef9c8e-91c8-4148-94b1-af2a3b597762}</Project>
</ProjectReference>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{E468DA07-48EA-40EB-A845-FA69C39D3396}</ProjectGuid>
Expand Down

0 comments on commit 42526a0

Please sign in to comment.