Skip to content

Build and Release .NET Desktop Console App #18

Build and Release .NET Desktop Console App

Build and Release .NET Desktop Console App #18

name: Build and Release .NET Desktop Console App
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.100' # Replace with the desired .NET SDK version
- name: Build the .NET Console App
run: |
dotnet restore
dotnet build ./SharpRISCV/SharpRISCV.csproj --configuration Release
# Archive the package
- name: Create archive
uses: vimtor/action-zip@v1
with:
files: ./SharpRISCV/bin/Release/net8.0/
dest: SharpRISCV.zip
# Create the release: https://github.com/actions/create-release
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
# Upload release asset: https://github.com/actions/upload-release-asset
- name: Update release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./SharpRISCV.zip
asset_name: SharpRISCV.zip
asset_content_type: application/zip