Skip to content

Updated changelog and version #7

Updated changelog and version

Updated changelog and version #7

name: Build and release
on:
push:
tags:
- "v*.*.*"
jobs:
build-release:
permissions: write-all
strategy:
matrix:
configuration: ['Release']
dotnet-version: ['3.1.426']
runs-on: windows-latest
# specify variables
env:
Solution_Name: LoxStatEdit.sln
Project_Path: LoxStatEdit.csproj
# checkout project und git clone project
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
# - name: List installed SDK versions
# run: dotnet --list-sdks
- name: Set SDK version
run: dotnet new globaljson --sdk-version ${{ matrix.dotnet-version }}
# You can test your matrix by printing the current dotnet version
- name: Display dotnet version
run: dotnet --version
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
# Execute all unit tests in the solution
- name: Execute unit tests
run: dotnet test
# Restore/Download all missing packages
- name: NuGet Restore
run: nuget restore $env:Solution_Name
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle
env:
Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64
Appx_Package_Build_Mode: StoreUpload
Configuration: ${{ matrix.configuration }}
# Remove unneeded data
- name: Remove unneeded data
run: |
Remove-Item -path .\bin\Release\LoxStatEdit.exe.config
Remove-Item -path .\bin\Release\LoxStatEdit.pdb
- name: show folder content
run: |
Get-ChildItem -Path .\bin\Release
# Rename folder
# - name: Rename folder
# run: Rename-Item -Path ".\bin\Release" -NewName "LoxStatEdit-${{ github.ref_name }}"
# - name: Create ZIP
# run: Compress-Archive ".\bin\LoxStatEdit-${{ github.ref_name }}" -DestinationPath ".\LoxStatEdit-${{ github.ref_name }}.zip"
# Create the release: https://github.com/actions/create-release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
#body: |
# Changes in this Release
# - First Change
# - Second Change
draft: false
prerelease: false
# Upload release asset: https://github.com/actions/upload-release-asset
- name: Update release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: LoxStatEdit-${{ github.ref_name }}.zip
# asset_name: LoxStatEdit-${{ github.ref_name }}.zip
asset_path: .\bin\Release\LoxStatEdit.exe
asset_name: LoxStatEdit.exe
asset_content_type: application/zip