Skip to content

Generate releases from tags #114

Generate releases from tags

Generate releases from tags #114

Workflow file for this run

name: Build
on:
- push
- pull_request
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_REPOSITORY: https://github.com/microsoft/vcpkg.git
VCPKG_REVISION: 137197a8f85e6c6cf1843ef024af7d9c28bb0bde
jobs:
static:
strategy:
fail-fast: true
matrix:
image:
- windows-2019
- windows-2022
name: static-${{ matrix.image }}
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- working-directory: 'C:/vcpkg'
run: git remote add openmw ${{ env.VCPKG_REPOSITORY }}
- working-directory: 'C:/vcpkg'
run: git fetch openmw
- working-directory: 'C:/vcpkg'
run: git checkout ${{ env.VCPKG_REVISION }}
- working-directory: 'C:/vcpkg'
run: ./bootstrap-vcpkg.bat -disableMetrics
- name: Install vcpkg packages
run: >
vcpkg install --overlay-ports=ports --triplet x64-windows-static
boost-geometry
boost-iostreams
boost-program-options
bullet3[double-precision,multithreading]
ffmpeg
freetype
icu
luajit
lz4
mygui
openal-soft
openmw-osg
sdl2
- name: Export installed vcpkg packages
run: >
vcpkg export
--x-all-installed
--raw
--output-dir ${{ github.workspace }}
--output intermediate
- name: Move pdb files
working-directory: '${{ github.workspace }}/intermediate'
run: |
robocopy installed pdb/installed *.pdb /S /MOVE
if ($lastexitcode -lt 8) {
$global:LASTEXITCODE = $null
}
- name: Archive pdb files
working-directory: '${{ github.workspace }}/intermediate/pdb'
run: 7z a "${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-static-pdb-${{ github.sha }}.7z" installed
- name: Store archived pdb files
uses: actions/upload-artifact@v4
with:
name: vcpkg-x64-${{ matrix.image }}-static-pdb-${{ github.sha }}
path: ${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-static-pdb-${{ github.sha }}.7z
- name: Archive everything else
working-directory: '${{ github.workspace }}/intermediate'
run: 7z a "${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-static-${{ github.sha }}.7z" * -x!pdb
- name: Store exported vcpkg packages
uses: actions/upload-artifact@v4
with:
name: vcpkg-x64-${{ matrix.image }}-static-${{ github.sha }}
path: ${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-static-${{ github.sha }}.7z
dynamic:
strategy:
fail-fast: true
matrix:
image:
- windows-2019
- windows-2022
name: dynamic-${{ matrix.image }}
runs-on: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- working-directory: 'C:/vcpkg'
run: git remote add openmw ${{ env.VCPKG_REPOSITORY }}
- working-directory: 'C:/vcpkg'
run: git fetch openmw
- working-directory: 'C:/vcpkg'
run: git checkout ${{ env.VCPKG_REVISION }}
- working-directory: 'C:/vcpkg'
run: ./bootstrap-vcpkg.bat -disableMetrics
- name: Install vcpkg packages
run: >
vcpkg install --overlay-ports=ports --triplet x64-windows
boost-geometry
boost-iostreams
boost-program-options
bullet3[double-precision,multithreading]
ffmpeg
freetype
icu
luajit
lz4
mygui
openal-soft
openmw-osg
sdl2
- name: Export installed vcpkg packages
run: >
vcpkg export
--x-all-installed
--raw
--output-dir ${{ github.workspace }}
--output intermediate
- name: Move pdb files
working-directory: '${{ github.workspace }}/intermediate'
run: |
robocopy installed pdb/installed *.pdb /S /MOVE
if ($lastexitcode -lt 8) {
$global:LASTEXITCODE = $null
}
- name: Archive pdb files
working-directory: '${{ github.workspace }}/intermediate/pdb'
run: 7z a "${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-pdb-${{ github.sha }}.7z" installed
- name: Store archived pdb files
uses: actions/upload-artifact@v4
with:
name: vcpkg-x64-${{ matrix.image }}-pdb-${{ github.sha }}
path: ${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-pdb-${{ github.sha }}.7z
- name: Archive everything else
working-directory: '${{ github.workspace }}/intermediate'
run: 7z a "${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-${{ github.sha }}.7z" * -x!pdb
- name: Store exported vcpkg packages
uses: actions/upload-artifact@v4
with:
name: vcpkg-x64-${{ matrix.image }}-${{ github.sha }}
path: ${{ github.workspace }}/vcpkg-x64-${{ matrix.image }}-${{ github.sha }}.7z
- name: Repackage binaries for symbol server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
run: .\Store-Symbols.ps1 ${{ github.workspace }}\intermediate
- name: Upload symbols to symbol server
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: eu-west-3
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
working-directory: ${{ github.workspace }}/SymStore
run: aws --endpoint-url https://rgw.ctrl-c.liu.se s3 sync --size-only --exclude * --include *.dl_ --include *.pd_ . s3://openmw-sym
push-dynamic:
needs:
- dynamic
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Rename artifacts
run: |
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2019-${{ github.sha }}.7z windows-2019.7z
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-${{ github.sha }}.7z windows-2022.7z
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2019-pdb-${{ github.sha }}.7z windows-2019-pdb.7z
mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-pdb-${{ github.sha }}.7z windows-2022-pdb.7z
- name: Release
uses: softprops/action-gh-release@v2
with:
files: windows-*.7z