Update LCVR to v1.2.0 #16
This file contains 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 Release | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: self-hosted | |
env: | |
DOTNET_INSTALL_DIR: ~/.dotnet | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up variables | |
id: vars | |
run: | | |
# Extract package version from project | |
version=$(grep -oP '<Version>\K[^<]+' LCVR.csproj) | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- name: Setup Dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0" | |
- name: Restore NuGet packages | |
run: dotnet restore | |
- name: Build NuGet package | |
run: dotnet pack -p:Version='${{ steps.vars.outputs.version }}' -c Release | |
- name: Upload NuGet package | |
if: github.event_name == 'push' | |
run: dotnet nuget push bin/Release/*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://nuget.daxcess.io/v3/index.json | |
- name: Build app | |
run: dotnet build -c Release | |
- name: Prepare and bundle package | |
run: | | |
# Set up template | |
unzip ~/lcvr/package-template.zip -d ./package | |
# Copy and sign release binary | |
cp bin/Release/netstandard2.1/LCVR.dll ./package/BepInEx/plugins/LCVR/ | |
gpg --output ./package/BepInEx/plugins/LCVR/LCVR.dll.sig --detach-sig ./package/BepInEx/plugins/LCVR/LCVR.dll | |
# Copy docs and license | |
cp CHANGELOG.md ./package/CHANGELOG.md | |
cp Docs/Thunderstore/README.md ./package/README.md | |
cp LICENSE ./package/LICENSE | |
# Update Thunderstore manifest | |
jq '.version_number = "${{ steps.vars.outputs.version }}"' ./package/manifest.json > ./package/manifest_new.json | |
mv ./package/manifest_new.json ./package/manifest.json | |
- name: Upload build artifacts | |
if: github.event_name == 'push' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: LCVR-${{ steps.vars.outputs.version }} | |
path: ./package |