78 lines
2.4 KiB
YAML
78 lines
2.4 KiB
YAML
name: Build and Relase
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '[0-9]+.[0-9]+.[0-9]+'
|
|
|
|
jobs:
|
|
build-release:
|
|
runs-on: windows-2022
|
|
|
|
steps:
|
|
|
|
#Check out the code from the repository
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
#Verify installed .NET Framework version (Optional Debug Step)
|
|
- name: Check .NET Framework version
|
|
run: |
|
|
reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release
|
|
|
|
- name: Run Replace-Version-Strings.ps1
|
|
run: |
|
|
.\Scripts\Replace-Version-Strings.ps1 -version "${{github.ref_name}}"
|
|
shell: pwsh
|
|
|
|
#Restore NuGet packages
|
|
- name: Restore NuGet packages
|
|
run: nuget restore SoraV2Utils.sln
|
|
|
|
#Build the project
|
|
- name: Build the solution
|
|
run: msbuild SoraV2Utils.sln /p:Configuration=Release /t:Rebuild
|
|
|
|
#Build the installer
|
|
- name: Build the installer
|
|
run: devenv SoraV2Utils.sln /Project SoraV2Utils_Setup\SoraV2Utils_Setup.vdproj /Build "Release"
|
|
|
|
#Upload the build artifact
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build-artifact
|
|
path: build/Release/
|
|
|
|
create-release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
#Checkout repository to access release-related metadata
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
#Download the build artifact
|
|
- name: Download build artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: build-artifact
|
|
path: ${{ github.workspace }}/artifact
|
|
|
|
- name: Archive Manual Release
|
|
run: (cd ${{ github.workspace }}/artifact && zip -r ${{ github.workspace }}/artifact/SoraV2UtilsBinarys${{github.ref_name}}.zip . -x "/*Installer/*")
|
|
|
|
- name: Rename Release Installer file
|
|
run: mv ${{ github.workspace }}/artifact/Installer/SoraV2Utils_Setup.msi ${{ github.workspace }}/artifact/Installer/SoraV2Utils_Setup${{github.ref_name}}.msi
|
|
|
|
- name: Release
|
|
uses: akkuman/gitea-release-action@v1
|
|
with:
|
|
name: "SoraV2Battery Helper ${{github.ref_name}}"
|
|
files: |-
|
|
${{ github.workspace }}/artifact/Installer/SoraV2Utils_Setup${{github.ref_name}}.msi
|
|
${{ github.workspace }}/artifact/SoraV2UtilsBinarys${{github.ref_name}}.zip
|
|
token: '${{secrets.KRJAN02_RELEASE_TOKEN}}'
|
|
tag_name: ${{github.ref_name}} |