Files
libloot/.github/workflows/release.yml
dependabot[bot]andGitHub f40f6588ea Bump astral-sh/setup-uv from 7.3.1 to 8.0.0
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 7.3.1 to 8.0.0.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/5a095e7a2014a4212f075830d4f7277575a9d098...cec208311dfd045dd5311c1add060b2062131d57)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-02 15:25:38 +00:00

128 lines
4.0 KiB
YAML

name: Release
on:
push:
tags: '*.*.*'
env:
CARGO_TERM_COLOR: always
CMAKE_CONFIG: RelWithDebInfo
jobs:
create_release:
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Create a draft GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_TAG="${{ github.ref_name }}"
RELEASE_TITLE="libloot v$RELEASE_TAG"
RELEASE_NOTES="$(printf "Requires Windows 10 or later, the [MSVC 2022 x64 redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe), and [7-Zip](http://www.7-zip.org/) to extract the archives.\n\n## Change Logs\n- [API](https://loot-api.readthedocs.io/en/latest/api/changelog.html)\n- [Metadata Syntax](https://loot-api.readthedocs.io/en/latest/metadata/changelog.html)")"
gh release create --draft --title "$RELEASE_TITLE" --notes "$RELEASE_NOTES" --verify-tag --repo "${{ github.repository }}" "$RELEASE_TAG"
windows:
runs-on: windows-2022
needs: create_release
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-x86_64-pc-windows-msvc-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set LIBLOOT_REVISION
shell: bash
run: echo "LIBLOOT_REVISION=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
- name: Run CMake
working-directory: cpp
run: |
cmake -G "Visual Studio 17 2022" `
-A x64 `
-DCPACK_PACKAGE_VERSION="${{ github.ref_name }}" `
-DCPACK_THREADS=0 `
-DRUST_TARGET="x86_64-pc-windows-msvc" `
-B build
cmake --build build --parallel --config ${{ env.CMAKE_CONFIG }}
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "0.8.20"
- name: Install packages for building docs
working-directory: docs
run: |
curl -sSfLO https://github.com/doxygen/doxygen/releases/download/Release_1_13_2/doxygen-1.13.2.windows.x64.bin.zip
$hash = Get-FileHash -Algorithm SHA256 doxygen-1.13.2.windows.x64.bin.zip
$expectedHash = 'DEDBCF1D05911AFC003989D33194AB95539E2EF4535CC00143B5917C22614406'
if ($hash.Hash -ne $expectedHash) {
throw 'Unexpected hash: $($hash.Hash)'
}
Expand-Archive doxygen-1.13.2.windows.x64.bin.zip
echo "${{ github.workspace }}\doxygen-1.13.2.windows.x64.bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
uv sync --locked
- name: Build docs
working-directory: docs
run: uv run --locked -- sphinx-build -b html . build/html
- name: Build archive
id: build-archive
shell: bash
working-directory: cpp/build
run: |
cpack -C ${{ env.CMAKE_CONFIG }}
echo "filename=libloot-${{ github.ref_name }}-win64.7z" >> "$GITHUB_OUTPUT"
- name: Upload archive to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload --repo "${{ github.repository }}" "${{ github.ref_name }}" cpp/build/package/${{ steps.build-archive.outputs.filename }}#${{ steps.build-archive.outputs.filename }}
publish:
runs-on: ubuntu-24.04
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v6
- uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
id: auth
- run: cargo publish -p libloot
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}