Update dotnet.yml #19
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 will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "master", "actions" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Setup NuGet | |
uses: NuGet/setup-nuget@v1.0.5 | |
- name: Restore NuGet packages | |
run: | | |
cd Magitek | |
nuget restore Magitek.sln | |
- name: Build solution | |
run: | | |
cd Magitek | |
msbuild Magitek.sln /p:Configuration=Release | |
- name: Generate Version.txt | |
run: echo $(git rev-parse HEAD) > ./bin/release/Version.txt | |
- name: Create Magitek.zip | |
run: | | |
powershell Compress-Archive -Path ./bin/release/Magitek.dll, ./bin/release/Version.txt, ./MagitekLoader/MagitekLoader.cs -DestinationPath ./bin/release/Magitek.zip | |
- name: Upload Artifacts for Release | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Magitek.zip | |
path: ./bin/release/Magitek.zip | |
- name: Upload Version.txt for Release | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Version.txt | |
path: ./bin/release/Version.txt | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.sha }} | |
release_name: Release ${{ github.sha }} | |
draft: false | |
prerelease: false | |
files: ./bin/release/Magitek.zip, ./bin/release/Version.txt |