Skip to content

Update dotnet.yml

Update dotnet.yml #43

Workflow file for this run

name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release --output ./output
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: "Automatic OSC Router"
path: "./output"
release:
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Delete Old Releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 0
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%d/%m/%Y %H:%M %t')"
- name: Create download directory
run: mkdir -p "./download"
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: "./download"
- name: List files in directory
run: Get-ChildItem -Path ./your-directory -Recurse
shell: pwsh
- name: Create A Release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: Latest Build [${{ steps.date.outputs.date }}]
tag_name: ${{ github.run_id }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Add zip To Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./download/Automatic OSC Router
asset_name: Automatic OSC Router.zip
asset_content_type: application/x-msdownload