Update dotnet.yml #44
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 | |
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 | |
id: list_files | |
run: | | |
$files = Get-ChildItem -Path ./your-directory -Recurse | |
echo "$files" | Out-String | Out-File -FilePath $env:GITHUB_ENV | |
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 |