Add TODO: actions/upload-release-asset is deprecated #55
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: # TODO: readd this when we are ready to create releases | |
# - "*.*" | |
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: | | |
$packageZipPath = .\Scripts\Make-Package.ps1 | |
echo "PACKAGE_ZIP_PATH=$packageZipPath" >> $env:GITHUB_ENV | |
shell: pwsh | |
- name: Extract filename from PACKAGE_ZIP_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; eplace 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 |