-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (70 loc) · 2.04 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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