Skip to content

Commit 83f2eea

Browse files
committed
add Create Release and Publish.yml
1 parent 635be7f commit 83f2eea

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Create Release and Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # 觸發條件:建立新 tag,例如 v1.0.0
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
publish:
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Checkout main repo
17+
uses: actions/checkout@v4
18+
with:
19+
repository: gpmagvs/VMSystem
20+
path: VMSystem
21+
ref: develop # 指定 branch 或 tag
22+
23+
- name: Checkout AGVSystemCommonNet6 repo
24+
uses: actions/checkout@v4
25+
with:
26+
repository: gpmagvs/AGVSystemCommonNet6 # 這裡換成你需要拉取的 repo
27+
path: AGVSystemCommonNet6
28+
ref: develop # 指定 branch 或 tag
29+
30+
- name: Checkout EquipmentManagment repo
31+
uses: actions/checkout@v4
32+
with:
33+
repository: gpmagvs/EquipmentManagment # 這裡換成你需要拉取的 repo
34+
path: EquipmentManagment
35+
ref: develop # 指定 branch 或 tag
36+
37+
- name: Checkout RosBridgeClient repo
38+
uses: actions/checkout@v4
39+
with:
40+
repository: gpmagvs/RosBridgeClient # 這裡換成你需要拉取的 repo
41+
path: RosBridgeClient
42+
ref: develop # 指定 branch 或 tag
43+
44+
- name: Checkout KGSWebAGVSystemAPI repo
45+
uses: actions/checkout@v4
46+
with:
47+
repository: gpmagvs/KGSWebAGVSystemAPI # 這裡換成你需要拉取的 repo
48+
path: KGSWebAGVSystemAPI
49+
ref: master # 指定 branch 或 tag
50+
51+
- name: Setup .NET
52+
uses: actions/setup-dotnet@v4
53+
with:
54+
dotnet-version: 8.0.411 # 依照你的專案需求調整
55+
56+
- name: Restore dependencies
57+
run: dotnet restore VMSystem/VMSystem.sln
58+
59+
- name: Publish project
60+
run: dotnet publish VMSystem/VMSystem.csproj -c Release -r win-x64 --self-contained true -o VMSystem-publish
61+
# 如果有多個設定檔,可以換成你需要的 pubxml
62+
63+
- name: Compress output
64+
run: |
65+
$tag = "${{ github.ref_name }}"
66+
$publishPath = Join-Path $PWD "VMSystem-publish"
67+
$zipPath = Join-Path $PWD "VMSystem-publish-$tag.zip"
68+
Compress-Archive -Path "$publishPath" -DestinationPath $zipPath -Force
69+
70+
- name: Create GitHub Release
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
body: |
74+
## 🚀 What's Changed
75+
- something changed
76+
77+
## 🐞 What's Fixed
78+
- something fixed
79+
80+
## 📦 HeadCommit Message
81+
82+
${{ github.event.head_commit.message }}
83+
84+
## 🔗 Full Changelog
85+
${{ github.server_url }}/${{ github.repository }}/compare/${{ github.event.release.tag_name }}^...${{ github.event.release.tag_name }}
86+
87+
files: VMSystem-publish-${{ github.ref_name }}.zip
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)