v1.4.2 #14
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Upload Release | |
on: | |
release: | |
types: [created] | |
permissions: | |
contents: write | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Ninja | |
run: choco install ninja --confirm | |
- name: Install Visual Studio 2022 Build Tools | |
uses: TheMrMilchmann/setup-msvc-dev@v3 | |
with: | |
arch: x64 | |
- name: Run build script | |
run: | | |
.github/scripts/build-windows.ps1 | |
- name: Run tests | |
run: | | |
cd out/build/x64-release | |
ninja | |
ctest | |
- name: Create zip file | |
run: powershell Compress-Archive -Path out\build\x64-release\loc\loc.exe,out\build\x64-release\loc\*.dll -DestinationPath out\build\x64-release\loc-windows-x64.zip | |
# Upload the zip file that we created to the release | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: out/build/x64-release/loc-windows-x64.zip | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install build tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential cmake ninja-build | |
- name: Run build script | |
run: | | |
chmod +x .github/scripts/build-linux.sh | |
.github/scripts/build-linux.sh | |
- name: Run tests | |
run: | | |
cd out/build/linux-release/ | |
ctest | |
- name: Create zip file | |
run: zip -j out/build/linux-release/loc-linux-x64.zip out/build/linux-release/loc/loc out/build/linux-release/loc/*.so.* | |
# Upload the zip file that we created to the release | |
- name: Upload Release Asset | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: out/build/linux-release/loc-linux-x64.zip | |