Skip to content

build: Change runs-on to windows-latest in release.yml #5

build: Change runs-on to windows-latest in release.yml

build: Change runs-on to windows-latest in release.yml #5

Workflow file for this run

name: Build and Release
on:
push:
branches:
- main
- update-resonite-mod-updater-utils
workflow_dispatch:
jobs:
build-and-release:
runs-on: windows-latest
permissions:
contents: write
env:
PROJECT: ResoniteModUpdater
DOTNET_VERSION: '8.0.x'
VPK_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Get Version from Project File
id: get-version
shell: bash
run: echo "version=$(grep -oE '<AssemblyVersion>[^<]+' ${{ env.PROJECT }}/${{ env.PROJECT }}.csproj | sed 's/<AssemblyVersion>//')" >> $GITHUB_OUTPUT
- name: Install Velopack CLI
run: dotnet tool install -g vpk
- name: Build and Pack (Linux)
run: |
dotnet publish ${{ env.PROJECT }}/${{ env.PROJECT }}.csproj -c Release -o publish/linux-x64 -r linux-x64 --self-contained
vpk download github --repoUrl ${{ github.server_url }}/${{ github.repository }} --channel linux-x64 -o releases
vpk pack -u ${{ env.PROJECT }} -v ${{ steps.get-version.outputs.version }} -r linux-x64 --channel linux-x64 -p publish/linux-x64 -o releases
vpk upload github --repoUrl ${{ github.server_url }}/${{ github.repository }} --releaseName "v${{ steps.get-version.outputs.version }}" --tag v${{ steps.get-version.outputs.version }} --channel linux-x64 -o releases
- name: Build and Pack (Windows)
run: |
dotnet publish ${{ env.PROJECT }}/${{ env.PROJECT }}.csproj -c Release -o publish/win-x64 -r win-x64 --no-self-contained
vpk download github --repoUrl ${{ github.server_url }}/${{ github.repository }} --channel win-x64 -o releases
vpk pack -u ${{ env.PROJECT }} -v ${{ steps.get-version.outputs.version }} -r win-x64 --channel win-x64 --noPortable --framework net8.0-x64-runtime -p publish/win-x64 -o releases
vpk upload github --repoUrl ${{ github.server_url }}/${{ github.repository }} --releaseName "v${{ steps.get-version.outputs.version }}" --tag v${{ steps.get-version.outputs.version }} --channel win-x64 -o releases
- name: Build and Pack (Windows portable)
run: |
dotnet publish ${{ env.PROJECT }}/${{ env.PROJECT }}.csproj -c Release -o publish/win-x64-portable -r win-x64 --self-contained
vpk download github --repoUrl ${{ github.server_url }}/${{ github.repository }} --channel win-x64-portable -o releases
vpk pack -u ${{ env.PROJECT }} -v ${{ steps.get-version.outputs.version }} -r win-x64 --channel win-x64-portable --noInst --packTitle win-x64-portable -p publish/win-x64-portable -o releases
mv releases/${{ env.PROJECT }}-win-x64-portable-Portable.zip releases/${{ env.PROJECT }}-win-x64-portable.zip
vpk upload github --repoUrl ${{ github.server_url }}/${{ github.repository }} --releaseName "v${{ steps.get-version.outputs.version }}" --tag v${{ steps.get-version.outputs.version }} --channel win-x64-portable -o releases