Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Commit 0b06e50

Browse files
authored
Publish artifacts on release (#13)
* Publish artifacts on release * publish only sdk
1 parent 822ecb4 commit 0b06e50

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

.github/workflows/build_gcc.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build .NET SDK (GCC)
22

3-
on: [workflow_dispatch]
3+
on: [workflow_dispatch, pull_request]
44

55
jobs:
66
build_with_gcc:
@@ -93,12 +93,8 @@ jobs:
9393
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.linux-riscv64.*.nupkg ${PACKAGESDIR}
9494
mkdir -p ${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}
9595
cp artifacts/packages/Release/Shipping/dotnet-runtime-*-linux-riscv64.tar.gz ${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}
96-
cp artifacts/packages/Release/Shipping/dotnet-runtime-*-linux-riscv64.tar.gz ${OUTPUTDIR}
9796
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Host.linux-riscv64.*.nupkg ${OUTPUTDIR}
9897
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.linux-riscv64.*.nupkg ${OUTPUTDIR}
99-
cp artifacts/packages/Release/Shipping/runtime.linux-riscv64.Microsoft.NETCore.DotNetAppHost.*.nupkg ${OUTPUTDIR}
100-
cp artifacts/packages/Release/Shipping/runtime.linux-riscv64.Microsoft.NETCore.ILAsm.*.nupkg ${OUTPUTDIR}
101-
cp artifacts/packages/Release/Shipping/runtime.linux-riscv64.Microsoft.NETCore.ILDAsm.*.nupkg ${OUTPUTDIR}
10298
cd .. && rm -r runtime
10399
104100
- name: Build aspnetcore
@@ -129,11 +125,19 @@ jobs:
129125
mkdir -p ${DOWNLOADDIR}/Sdk/${SDK_VERSION}
130126
cp artifacts/packages/Release/NonShipping/dotnet-toolset-internal-*.zip ${DOWNLOADDIR}/Sdk/${SDK_VERSION}/dotnet-toolset-internal-${SDK_VERSION}.zip
131127
cp artifacts/packages/Release/Shipping/Microsoft.DotNet.Common.*.nupkg ${PACKAGESDIR}
132-
cp artifacts/packages/Release/Shipping/dotnet-sdk-*-linux-riscv64.tar.gz ${OUTPUTDIR}
133-
cp artifacts/packages/Release/Shipping/dotnet-sdk-*-linux-riscv64.tar.gz.sha512 ${OUTPUTDIR}
128+
cp artifacts/packages/Release/Shipping/dotnet-sdk-*-linux-riscv64.tar.gz ${OUTPUTDIR}/dotnet-sdk-${SDK_VERSION}-linux-riscv64-gcc-${{ matrix.os }}.tar.gz
129+
cp artifacts/packages/Release/Shipping/dotnet-sdk-*-linux-riscv64.tar.gz.sha512 ${OUTPUTDIR}/dotnet-sdk-${SDK_VERSION}-linux-riscv64-gcc-${{ matrix.os }}.tar.gz.sha512
134130
135131
- name: Upload .NET
136132
uses: actions/upload-artifact@v4
133+
if: startsWith(github.ref, 'refs/tags/') != true
137134
with:
138135
name: "dotnet-sdk-linux-riscv64-gcc-${{ matrix.os }}"
139-
path: "${{ github.workspace }}/output/*"
136+
path: "${{ github.workspace }}/output/dotnet-sdk-*.tar.gz*"
137+
138+
- name: Release
139+
uses: softprops/action-gh-release@v2
140+
if: startsWith(github.ref, 'refs/tags/')
141+
with:
142+
files: |
143+
${{ github.workspace }}/output/dotnet-sdk-*.tar.gz*

.github/workflows/main.yaml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build .NET SDK
22

3-
on: [workflow_dispatch]
3+
on: [workflow_dispatch, pull_request]
44

55
jobs:
66
run:
@@ -34,9 +34,9 @@ jobs:
3434
3535
- name: Build runtime
3636
run: |
37-
mkdir -p ${PACKAGESDIR}
38-
mkdir -p ${DOWNLOADDIR}
39-
mkdir -p ${OUTPUTDIR}
37+
rm -rf ${PACKAGESDIR} && mkdir -p ${PACKAGESDIR}
38+
rm -rf ${DOWNLOADDIR} && mkdir -p ${DOWNLOADDIR}
39+
rm -rf ${OUTPUTDIR} && mkdir -p ${OUTPUTDIR}
4040
4141
cd runtime
4242
sed -i "s|<PublishTrimmed>true</PublishTrimmed>|<PublishTrimmed Condition=\"\'$\(TargetArchitecture\)\' != \'riscv64\'\">true</PublishTrimmed>|" src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
@@ -45,12 +45,8 @@ jobs:
4545
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.linux-riscv64.*.nupkg ${PACKAGESDIR}
4646
mkdir -p ${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}
4747
cp artifacts/packages/Release/Shipping/dotnet-runtime-*-linux-riscv64.tar.gz ${DOWNLOADDIR}/Runtime/${RUNTIME_VERSION}
48-
cp artifacts/packages/Release/Shipping/dotnet-runtime-*-linux-riscv64.tar.gz ${OUTPUTDIR}
4948
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Host.linux-riscv64.*.nupkg ${OUTPUTDIR}
5049
cp artifacts/packages/Release/Shipping/Microsoft.NETCore.App.Runtime.linux-riscv64.*.nupkg ${OUTPUTDIR}
51-
cp artifacts/packages/Release/Shipping/runtime.linux-riscv64.Microsoft.NETCore.DotNetAppHost.*.nupkg ${OUTPUTDIR}
52-
cp artifacts/packages/Release/Shipping/runtime.linux-riscv64.Microsoft.NETCore.ILAsm.*.nupkg ${OUTPUTDIR}
53-
cp artifacts/packages/Release/Shipping/runtime.linux-riscv64.Microsoft.NETCore.ILDAsm.*.nupkg ${OUTPUTDIR}
5450
cd .. && rm -r runtime
5551
5652
- name: Build aspnetcore
@@ -87,6 +83,14 @@ jobs:
8783
8884
- name: Upload .NET
8985
uses: actions/upload-artifact@v4
86+
if: startsWith(github.ref, 'refs/tags/') != true
9087
with:
9188
name: dotnet-sdk-linux-riscv64
92-
path: "${{ github.workspace }}/output/*"
89+
path: "${{ github.workspace }}/output/dotnet-sdk-*.tar.gz*"
90+
91+
- name: Release
92+
uses: softprops/action-gh-release@v2
93+
if: startsWith(github.ref, 'refs/tags/')
94+
with:
95+
files: |
96+
${{ github.workspace }}/output/dotnet-sdk-*.tar.gz*

0 commit comments

Comments
 (0)