Skip to content

Set version to 0.21.0 #5

Set version to 0.21.0

Set version to 0.21.0 #5

Workflow file for this run

name: Release
on:
push:
tags: '*'
env:
MSVC_CONFIG: RelWithDebInfo
jobs:
create_release:
runs-on: ubuntu-20.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: LOOT Metadata Validator v${{ steps.get-git-tag.outputs.name }}
body: |
Windows users should download the file with the `7z` file extension. It requires Windows 7 or later and the [MSVC 2019 x86 redistributable](https://aka.ms/vs/16/release/vc_redist.x86.exe), and [7-Zip](http://www.7-zip.org/) to extract the archive.
The `metadata-validator.tar.xz` file contains a Linux binary.
linux:
runs-on: ubuntu-20.04
needs: create_release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- 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: Install APT package dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
g++-10 \
libtbb-dev
- name: Get ICU
id: get-icu
run: |
wget https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-Ubuntu20.04-x64.tgz
tar -xf icu4c-71_1-Ubuntu20.04-x64.tgz
echo "root=${{ github.workspace }}/icu/usr/local" >> $GITHUB_OUTPUT
- name: Run CMake
run: |
mkdir build
cd build
export CXX="g++-10" CC="gcc-10"
cmake .. -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.version }}" -DICU_ROOT="${{ steps.get-icu.outputs.root }}"
make all
- name: Build archive
id: build-archive
shell: bash
run: |
cd build
cpack
VERSION="${{ steps.get-version.outputs.version }}"
echo "filename=metadata-validator-${VERSION}-Linux.tar.xz" >> $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/octet-stream
windows:
runs-on: windows-2019
needs: create_release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- 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 16 2019" -A Win32 -DCPACK_PACKAGE_VERSION="${{ steps.get-version.outputs.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 }}"
echo "filename=metadata-validator-${VERSION}-win32.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