Add actions to create release #25
Workflow file for this run
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
# This workflow build the release version of AutoTx. | |
# It uses the Github runner `windows-2019`, which still supports .Net framework 4 | |
# according to this page: | |
# https://github.com/orgs/community/discussions/25253 | |
name: .NET Core Desktop | |
on: | |
push: | |
tags: | |
- "*.*" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# configuration: [Debug, Release] # commented this for the moment, because below msbuild is called with "Release" config | |
configuration: [Debug] | |
# this is the last Github runner VM that supports .Net Framework 2019 | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
lfs: "true" | |
- name: setup-msbuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup NuGet.exe for use with actions | |
uses: NuGet/[email protected] | |
- name: setup-msbuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Restore Packages | |
run: nuget restore AutoTx.sln | |
- name: Build solution | |
run: .\Scripts\msbuild\build\release.cmd | |
- name: Package release | |
run: .\Scripts\Make-Package.ps1 | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} # Use the tag name | |
release_name: Release ${{ github.ref_name }} | |
body: | | |
Description of the release. | |
draft: false | |
prerelease: false | |
- name: Find the built ZIP file | |
id: find_zip | |
run: | | |
ZIP_FILE=$(find ./path/to/your/ -name "asset_*.zip" -print -quit) | |
echo "ZIP_FILE=$ZIP_FILE" >> $GITHUB_ENV | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.ZIP_FILE }} | |
asset_name: $(basename ${{ env.ZIP_FILE }}) | |
asset_content_type: application/zip |