Release #8
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: true | |
jobs: | |
build: | |
runs-on: windows-latest | |
env: | |
App_Packages_Archive: IdeapadToolkit.zip | |
License_Path: IdeapadToolkit\Properties\PublishProfiles\3RD_PARTY_LICENSES.txt | |
App_Publish_Directory: bin\Release\net8.0-windows\publish\win-x64 | |
App_Project_Directory: IdeapadToolkit\ | |
Solution_Path: IdeapadToolkit.sln | |
Project_Path: IdeapadToolkit\IdeapadToolkit.csproj | |
Actions_Allow_Unsecure_Commands: true # Allows AddPAth and SetEnv commands | |
Configuration: Release | |
RuntimeIdentifier: win-x64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
# Install the .NET Core workload | |
- name: Install .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
# Add MsBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
# Restore the application | |
- name: Restore the Wpf application to populate the obj folder | |
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier | |
# Build the Windows Application Packaging project for Prod_Store | |
- name: Build using the publish profile | |
run: dotnet publish /p:Configuration=Release /p:PublishProfile=FolderProfile | |
# Copy license file to the publish directory | |
- name: Copy license file to the publish directory | |
run: Copy-Item -Path $env:License_Path -Destination $env:App_Project_Directory\$env:App_Publish_Directory\ | |
# Create archive | |
- name: Create archive | |
run: Compress-Archive -Path $env:App_Project_Directory\$env:App_Publish_Directory\* -DestinationPath $env:App_Project_Directory\$env:App_Publish_Directory\$env:App_Packages_Archive | |
# Create the release: https://github.com/actions/create-release | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.event.inputs.version }} | |
release_name: Release ${{ github.event.inputs.version }} | |
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: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} # 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 | |
asset_path: ${{ env.App_Project_Directory }}\${{ env.App_Publish_Directory }}\${{ env.App_Packages_Archive }} | |
asset_name: ${{ env.App_Packages_Archive }} | |
asset_content_type: application/zip |