Skip to content

Commit

Permalink
Merge pull request #23 from fjuma/SSLNTV-32
Browse files Browse the repository at this point in the history
[SSLNTV-32] Add a new GitHub workflow to trigger native builds for pull requests and tags for Windows
  • Loading branch information
Skyllarr authored Jan 3, 2023
2 parents 416afbe + 9a144c6 commit 8b854a2
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/build-natives.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Build Natives
on:
pull_request:
branches:
- main
push:
tags:
- '*'

jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: main
strategy:
matrix:
os: [windows-latest]
include:
- os: windows-latest
vcvars: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
steps:
- uses: actions/checkout@v2
with:
path: main
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Checkout wildfly-openssl for test purposes
uses: actions/checkout@v2
with:
repository: wildfly-security/wildfly-openssl
path: wildfly-openssl
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Maven Version Info
run: mvn -version
- if: matrix.os != 'windows-latest'
name: OpenSSL Library Version Info
run: openssl version -v
- if: matrix.os == 'windows-latest'
name: Install Full OpenSSL Library
run: |
vcpkg install openssl:x64-windows
- if: matrix.os != 'windows-latest'
name: Build with Maven
run: |
openssl version -v
mvn -B package --file pom.xml
- if: matrix.os == 'windows-latest'
name: Build with Microsoft Visual Studio native tools command prompt and Maven
env:
VCVARS: ${{ matrix.vcvars }}
shell: cmd
run: |
call "%VCVARS%" x64
set PATH=C:\vcpkg\installed\x64-windows\tools\openssl;%PATH%
openssl version -v
mvn -B install --file pom.xml
- if: matrix.os == 'windows-latest'
name: Run tests with the built Windows native
env:
VCVARS: ${{ matrix.vcvars }}
working-directory: wildfly-openssl
shell: cmd
run: |
call "%VCVARS%" x64
set PATH=C:\vcpkg\installed\x64-windows\tools\openssl;%PATH%
openssl version -v
for /f "tokens=3 delims=<> skip=1" %%v in ('findstr "<version>" ..\main\pom.xml') do set WILDFLY_OPENSSL_NATIVES_VERSION=%%v
echo Running tests with WildFly OpenSSL Natives %WILDFLY_OPENSSL_NATIVES_VERSION%
mvn -B verify --file pom.xml -Dorg.wildfly.openssl.path="C:\vcpkg\installed\x64-windows\tools\openssl" -Dversion.org.wildfly.openssl.natives=%WILDFLY_OPENSSL_NATIVES_VERSION%
- if: ${{ github.event_name == 'push' }}
name: Archive the built native artifacts if this is a tag
uses: actions/upload-artifact@v2
with:
name: built-natives
path: |
**/target/**.jar

0 comments on commit 8b854a2

Please sign in to comment.