mirror of
https://github.com/loot/libloot-python.git
synced 2026-07-27 14:14:13 -07:00
windows-2019 will be fully retired by the end of June, and 2025 is the latest version. This means that Windows build artifacts will be built using MSVC 2022, not MSVC 2019. They should be ABI-compatible across this change, since they expose no third-party types and Microsoft say that their compiler and standard library didn't break ABI between 2019 and 2022, but a newer version of the redistributable might be needed.
93 lines
2.8 KiB
YAML
93 lines
2.8 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: '*'
|
|
|
|
env:
|
|
MSVC_CONFIG: RelWithDebInfo
|
|
|
|
jobs:
|
|
create_release:
|
|
runs-on: ubuntu-18.04
|
|
outputs:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
git_tag: ${{ steps.get-git-tag.outputs.name }}
|
|
|
|
steps:
|
|
- name: Get Git tag
|
|
id: get-git-tag
|
|
run: echo "name=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
|
|
|
- id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ steps.get-git-tag.outputs.name }}
|
|
release_name: libloot-python v${{ steps.get-git-tag.outputs.name }}
|
|
body: |
|
|
Requires Windows 7 or later and the [MSVC 2022 x86 redistributable](https://aka.ms/vs/17/release/vc_redist.x86.exe), and [7-Zip](http://www.7-zip.org/) to extract the archive.
|
|
|
|
windows:
|
|
runs-on: windows-2025
|
|
needs: create_release
|
|
|
|
strategy:
|
|
matrix:
|
|
platform: [Win32, x64]
|
|
python-version: [3.7]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Get descriptive version
|
|
id: get-version
|
|
shell: bash
|
|
run: |
|
|
GIT_DESCRIBE=$(git describe --tags --long --abbrev=7)
|
|
DESC_REF=${GIT_DESCRIBE}_${GITHUB_REF#refs/*/}
|
|
SAFE_DESC_REF=${DESC_REF//[\/<>\"|]/_}
|
|
echo "version=$SAFE_DESC_REF" >> $GITHUB_OUTPUT
|
|
|
|
- name: Run CMake
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake .. -G "Visual Studio 17 2022" -A ${{ matrix.platform }} -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
|
|
cmake --build . --config ${{ env.MSVC_CONFIG }}
|
|
|
|
- name: Build archive
|
|
id: build-archive
|
|
shell: bash
|
|
run: |
|
|
cd build
|
|
cpack -C ${{ env.MSVC_CONFIG }}
|
|
|
|
VERSION="${{ steps.get-version.outputs.version }}-python${{ matrix.python-version }}"
|
|
if [[ "${{ matrix.platform }}" == "Win32" ]]
|
|
then
|
|
PLATFORM=win32
|
|
else
|
|
PLATFORM=win64
|
|
fi
|
|
|
|
echo "filename=libloot-python-${VERSION}-${PLATFORM}.zip" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload Archive
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
|
asset_path: build/package/${{ steps.build-archive.outputs.filename }}
|
|
asset_name: ${{ steps.build-archive.outputs.filename }}
|
|
asset_content_type: application/x-7z-compressed
|