Build AutoTx Release #58
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: Build AutoTx Release | |
on: | |
push: | |
branches: | |
- "feature/20240305-setup-github-actions" | |
tags: | |
- "build-workflow*" | |
- "[0-9]+.[0-9]+.[0-9]+*" | |
pull_request: | |
branches: | |
- "master" | |
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 code base | |
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: Restore NuGet 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: Get filename from Zip file path | |
run: | | |
$packageZipName = [System.IO.Path]::GetFileName($env:PACKAGE_ZIP_PATH) | |
echo "PACKAGE_ZIP_NAME=$packageZipName" >> $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 | |
# TODO: get release description from change log | |
body: | | |
Description of the release. | |
draft: ${{ github.ref != 'refs/heads/master' }} | |
prerelease: true # TODO: revert this to false | |
# TODO: This is unmaintained; replace with: https://github.com/softprops/action-gh-release | |
- name: Upload Zip file of build to release | |
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: ${{ env.PACKAGE_ZIP_NAME }} | |
asset_content_type: application/zip |