Skip to content

Commit e3be996

Browse files
committed
Update workflow
1 parent 8b63740 commit e3be996

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed
Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: OpenSilver.TypeScriptDefinitionsToCSharp Build
22

3+
env:
4+
NEXT_RELEASE_VERSION: '3.4.0'
5+
36
on:
47
workflow_dispatch:
58
inputs:
@@ -8,7 +11,18 @@ on:
811
required: true
912
version:
1013
description: 'OpenSilver.TypeScriptDefinitionsToCSharp package version'
11-
required: true
14+
required: false
15+
default: ''
16+
publish-myget:
17+
description: 'Publish to MyGet.org'
18+
required: false
19+
type: boolean
20+
default: true
21+
publish-nuget-org:
22+
description: 'Publish to NuGet.org'
23+
required: false
24+
type: boolean
25+
default: false
1226

1327
jobs:
1428
Build-Pack-Publish:
@@ -18,15 +32,37 @@ jobs:
1832
- uses: microsoft/setup-msbuild@v1.1
1933
- name: Inject slug/short variables
2034
uses: rlespinasse/github-slug-action@v3.x
21-
- uses: actions/setup-dotnet@v1
35+
- uses: actions/setup-dotnet@v5
2236
with:
23-
dotnet-version: '8.0.x'
37+
dotnet-version: '10.x'
38+
dotnet-quality: 'ga'
39+
2440
- name: Clone OpenSilver.TypeScriptDefinitionsToCSharp repo
25-
uses: actions/checkout@v2
41+
uses: actions/checkout@v3
2642
with:
2743
ref: ${{ github.ref }}
44+
45+
- name: Format Package Version
46+
id: version
47+
shell: pwsh
48+
run: |
49+
$v = "${{ github.event.inputs.version }}"
50+
if ([string]::IsNullOrWhiteSpace($v))
51+
{
52+
$timestamp = Get-Date -Format "yyyy-MM-dd-HHmmss"
53+
$v = "$env:NEXT_RELEASE_VERSION-preview-$timestamp-$env:GITHUB_SHA_SHORT"
54+
}
55+
"value=$v" >> $env:GITHUB_OUTPUT
56+
2857
- name: Build OpenSilver.TypeScriptDefinitionsToCSharp NuGet package
29-
run: ./build/Build_NuGet.bat ${{ github.event.inputs.version }} ${{ github.event.inputs.opensilver-version }}
58+
run: ./build/Build_NuGet.bat ${{ steps.version.outputs.value }} ${{ github.event.inputs.opensilver-version }}
59+
3060
- name: Upload packages to MyGet
61+
if: ${{ inputs['publish-myget'] }}
3162
run: |
32-
dotnet nuget push "build\output\*.nupkg" -k ${{ secrets.MYGET_TOKEN }} -s https://www.myget.org/F/opensilver/api/v2/package
63+
dotnet nuget push "build\output\*.nupkg" -k ${{ secrets.MYGET_TOKEN }} -s https://www.myget.org/F/opensilver/api/v2/package
64+
65+
# - name: Upload packages to NuGet.org
66+
# if: ${{ inputs['publish-nuget-org'] }}
67+
# run: |
68+
# dotnet nuget push "build\output\*.nupkg" -k ${{ secrets.NUGET_ORG_API_KEY }} -s https://api.nuget.org/v3/index.json

0 commit comments

Comments
 (0)