Skip to content

Commit

Permalink
add external project github action
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Aug 29, 2024
1 parent 55638c4 commit d943b2c
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/external.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: windows-external-project

on: [push, workflow_dispatch]

env:
VCPKG_BINARY_SOURCES : 'clear;nuget,GitHub,readwrite'
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
VCPKG_VERSION: 'master'

jobs:

build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: ['windows-2019']
include:
- os: 'windows-2019'
triplet: 'x64-windows'
mono: ''
VCPKG_WORKSPACE: 'c:/vcpkg_own'

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

- name: Cloning vcpkg main branch (windows)
shell: 'bash'
run: |
cmake -E make_directory ${{ matrix.VCPKG_WORKSPACE }}
cd ${{ matrix.VCPKG_WORKSPACE }}
git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.bat -disableMetrics
${{ matrix.VCPKG_WORKSPACE }}/vcpkg/vcpkg version
- name: 'Setup NuGet Credentials'
working-directory: ${{ matrix.VCPKG_WORKSPACE }}
shell: 'bash'
run: |
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` \
sources add \
-source "https://nuget.pkg.github.com/${{ github.actor }}/index.json" \
-storepasswordincleartext \
-name "GitHub" \
-username "${{ github.actor }}" \
-password "${{ secrets.GITHUB_TOKEN }}"
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-source "https://nuget.pkg.github.com/${{ github.actor }}/index.json"
- name: Create Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{ runner.workspace }}/build
run: |
cmake $GITHUB_WORKSPACE/share/ExternalProject -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=${{ matrix.VCPKG_WORKSPACE }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_MANIFEST_DIR=$GITHUB_WORKSPACE/share/ExternalProject
- name: 'Upload cmake configure log artifact'
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: cmake-log
path: |
${{ runner.workspace }}/build/CMakeCache.txt
retention-days: 1

- name: Build
working-directory: ${{ runner.workspace }}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
11 changes: 11 additions & 0 deletions share/ExternalProject/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "osgearth-external-project",
"version-string": "1.0",
"port-version": 1,
"description": "osgEarth - External Project Text",
"homepage": "https://github.com/gwaldron/osgearth",
"supports": "!(x86 | wasm32)",
"dependencies": [
"osgearth"
]
}

0 comments on commit d943b2c

Please sign in to comment.