-
Notifications
You must be signed in to change notification settings - Fork 11
133 lines (111 loc) · 4.4 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Release
on:
push:
tags: '*'
env:
BOOST_VERSION: 1.87.0
CARGO_TERM_COLOR: always
MSVC_CONFIG: RelWithDebInfo
jobs:
create_release:
runs-on: ubuntu-24.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 v${{ steps.get-git-tag.outputs.name }}
body: |
Requires Windows 7 or later, the MSVC 2019 [x86](https://aka.ms/vs/16/release/vc_redist.x86.exe) or [x64](https://aka.ms/vs/16/release/vc_redist.x64.exe) redistributable for 32-bit and 64-bit builds respectively, and [7-Zip](http://www.7-zip.org/) to extract the archives.
## Change Logs
- [API](https://loot-api.readthedocs.io/en/latest/api/changelog.html)
- [Metadata Syntax](https://loot-api.readthedocs.io/en/latest/metadata/changelog.html)
windows:
runs-on: windows-2019
needs: create_release
strategy:
matrix:
platform: [Win32, x64]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust i686-pc-windows-msvc target
run: rustup target add i686-pc-windows-msvc
- name: Get Boost metadata
id: boost-metadata
run: |
$BOOST_ROOT="${{ github.workspace }}/boost_" + $env:BOOST_VERSION -replace "\.", "_"
echo "root=$BOOST_ROOT" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
- name: Boost cache
id: boost-cache
uses: actions/cache@v4
with:
path: |
${{ steps.boost-metadata.outputs.root }}/boost
${{ steps.boost-metadata.outputs.root }}/stage
key: ${{ runner.os }}-x64-Boost-${{ env.BOOST_VERSION }}
# Need to build Boost's 'system' stub to generate the CMake config file.
- name: Download & build Boost
run: |
curl -sSfLO https://raw.githubusercontent.com/Ortham/ci-scripts/2.2.1/install_boost.py
python install_boost.py --directory ${{ github.workspace }} --boost-version ${{ env.BOOST_VERSION }} -a 64 system
if: steps.boost-cache.outputs.cache-hit != 'true'
- name: Run CMake
run: |
cmake -G "Visual Studio 16 2019" `
-A ${{ matrix.platform }} `
-DCMAKE_PREFIX_PATH="${{ steps.boost-metadata.outputs.root }}\stage" `
-DCPACK_PACKAGE_VERSION="${{ needs.create_release.outputs.git_tag }}" `
-B build
cmake --build build --config ${{ env.MSVC_CONFIG }}
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install packages for building docs
run: |
nuget install doxygen -Version 1.8.14
echo "${{ github.workspace }}\Doxygen.1.8.14\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
python -m pip install -r docs/requirements.txt
- name: Build docs
run: sphinx-build -b html docs build\docs\html
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack -C ${{ env.MSVC_CONFIG }}
if [[ "${{ matrix.platform }}" == "Win32" ]]
then
PLATFORM=win32
else
PLATFORM=win64
fi
echo "filename=libloot-${{ needs.create_release.outputs.git_tag }}-${PLATFORM}.7z" >> $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