Create LICENSE #10
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
name: .NET Release Workflow | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.0' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build and Publish | |
run: dotnet publish -c Release -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --output publish/ | |
- name: Zip the output | |
run: Compress-Archive -Path publish/* -DestinationPath release.zip | |
# Get Release ID for the existing release | |
- name: Get Release ID | |
id: get_release | |
run: | | |
echo "RELEASE_ID=$(curl -s -X GET -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
"https://api.github.com/repos/${{ github.repository }}/releases/tags/v1.0" | jq -r .id)" >> $GITHUB_ENV | |
shell: bash | |
# Upload Release Asset to the existing release | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets?name=release-win64.zip | |
asset_path: ./release.zip | |
asset_name: release-win64.zip | |
asset_content_type: application/zip |