Append Zip file of build to Github release #48
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: | |
branches: | |
- "feature/20240305-setup-github-actions" | |
# 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/checkout@v4.1.1 | |
with: | |
fetch-depth: 0 | |
lfs: "true" | |
- name: setup-msbuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Setup NuGet.exe for use with actions | |
uses: NuGet/setup-nuget@v2.0.0 | |
- 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: | | |
$packageZipPath = .\Scripts\Make-Package.ps1 | |
echo "PACKAGE_ZIP_PATH=$packageZipPath" >> $env:GITHUB_ENV | |
shell: pwsh | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.sha }} # TODO: revert this to use github.ref_name for the version tag | |
release_name: AutoTx-${{ github.sha }} # TODO: use version tag here | |
body: | | |
Description of the release. | |
draft: ${{ github.ref != 'refs/heads/master' }} | |
prerelease: true # TODO: revert this to false | |
- 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.PACKAGE_ZIP_PATH }} | |
asset_name: $(basename ${{ env.PACKAGE_ZIP_PATH }}) | |
asset_content_type: application/zip |