Skip to content

Update draft-release.yml #21

Update draft-release.yml

Update draft-release.yml #21

Workflow file for this run

name: Draft Release
on:
push:
tags:
- '*.*.*'
# branches: [ "main" ]
pull_request:
# branches: [ "main" ]
env:
CONFIGURATION: Release
PLATFORM: x64
jobs:
build:
runs-on: windows-latest
env:
Solution_Name: MemoGenerator.sln
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=${{ env.CONFIGURATION }} /p:Platform=${{ env.PLATFORM }}
- name: Build
run: msbuild $env:Solution_Name /p:Configuration=${{ env.CONFIGURATION }} /p:Platform=${{ env.PLATFORM }}
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
# Name of the artifact to upload.
name: MemoGenerator-${{ github.ref_name }}-${{ env.PLATFORM }}
# A file, directory or wildcard pattern that describes what to upload
path: MemoGenerator/bin/${{ env.PLATFORM }}/Release/net6.0-windows10.0.18362.0/**
# - name: Archive
# run: |
# cd MemoGenerator/bin/${{ env.PLATFORM }}/Release
# tar -c -f MemoGenerator-${{ github.ref_name }}-${{ env.PLATFORM }}.zip net6.0-windows10.0.18362.0
create_release:
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
id: download-artifact
with:
# Name of the artifact to download.
# If unspecified, all artifacts for the run are downloaded.
# Optional.
name: MemoGenerator-${{ github.ref_name }}-${{ env.PLATFORM }}
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.download-artifact.outputs.download-path }}
draft: true