Skip to content

Commit 4c92807

Browse files
committed
2 parents 3b048d2 + 9cf6c35 commit 4c92807

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET Build And Publish Release
5+
6+
on:
7+
push:
8+
#branches:
9+
# - "**"
10+
tags:
11+
- "v.[0-9]+.[0-9]+.[0-9]+"
12+
#pull_request:
13+
# branches:
14+
# - "**"
15+
env:
16+
VERSION: 1.0.0
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
PROJECT_NAME: RemotePythonExecution
19+
OUTPUT_ARM64_DIR: publish/arm64
20+
OUTPUT_WIN64_DIR: publish/win64
21+
22+
jobs:
23+
build:
24+
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Set Version Variable
31+
if: ${{ github.ref_type == 'tag' }}
32+
env:
33+
TAG: ${{ github.ref_name }}
34+
run: echo "VERSION=${TAG#v.}" >> $GITHUB_ENV
35+
36+
- name: Setup .NET
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: 8.0.x
40+
41+
- name: Create service_info.json file
42+
run: |
43+
cd src/$PROJECT_NAME
44+
dotnet run [--environment Development] --version
45+
46+
- name: Publish
47+
run: |
48+
dotnet publish src/$PROJECT_NAME --output $OUTPUT_ARM64_DIR -c Release --self-contained true --runtime linux-arm64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:Version=$VERSION
49+
dotnet publish src/$PROJECT_NAME --output $OUTPUT_WIN64_DIR -c Release --self-contained true --runtime win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:Version=$VERSION
50+
51+
- name: Zip arm64 release
52+
uses: vimtor/action-zip@v1.2
53+
with:
54+
files: "${{ env.OUTPUT_ARM64_DIR }} service_info.json"
55+
recursive: true
56+
dest: "${{ env.PROJECT_NAME }}.arm64.portable.zip"
57+
58+
- name: Zip win64 release
59+
uses: vimtor/action-zip@v1.2
60+
with:
61+
files: "${{ env.OUTPUT_WIN64_DIR }} service_info.json"
62+
recursive: true
63+
dest: "${{ env.PROJECT_NAME }}.win64.portable.zip"
64+
65+
- name: Publish Release
66+
uses: "slord399/action-automatic-releases@v1.0.1"
67+
with:
68+
title: "Release v.${{ env.VERSION }}"
69+
repo_token: "${{ env.GITHUB_TOKEN }}"
70+
automatic_release_tag: "v.${{ env.VERSION }}"
71+
prerelease: false
72+
files: |
73+
*.zip

0 commit comments

Comments
 (0)