Skip to content

Commit

Permalink
Create dotnet-desktop.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-shodan committed Jun 29, 2023
1 parent 3a9e551 commit f221b0e
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M')"
- name: Restore dependencies
run: dotnet restore
- name: Build runtime required version
run: dotnet build --no-restore --no-self-contained -c Release src/Seahaven.csproj
- name: Build monolithic version
run: dotnet publish --self-contained true -p:PublishSingleFile=true -p:PublishedTrimmed=true -p:PublishReadyToRun=true -p:Configuration=Release -p:IncludeAllContentForSelfExtract=true -p:PublishReadyToRunShowWarnings=true src/Seahaven.csproj
- name: Zip artifact for monolithic deployment
run: zip --junk-paths seahaven-no-dotnet-runtime.zip ./src/Seahaven/bin/Release/net6.0/Any CPU/publish/* -r
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: release_${{ steps.date.outputs.date }}
release_name: Release ${{ github.ref_name }} - ${{ steps.date.outputs.date }}
draft: false
prerelease: false
body: Latest automatically built release
- name: Upload Release Asset
id: upload-release-asset-monolithic
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: ./seahaven-no-dotnet-runtime.zip.zip
asset_name: seahaven-no-dotnet-runtime.zip.zip
asset_content_type: application/zip

0 comments on commit f221b0e

Please sign in to comment.