ตัวอย่าง
ต้องการ Build และ Release โปรเจคชื่อ ServiceScheduler
ทุกครั้งที่สร้าง Tag ใหม่ใน GitHub โดยนำ Release ที่ได้ Upload ไปยัง GitHub ในรูปแบบของไฟล์ Zip และใช้เลขเวอร์ชันเดียวกับ Tag
ขั้นตอน
- สร้างโปรเจค ชื่อ
ServiceScheduler
เป็นWebApi
dotnet new webapi --language C# --output src/ServiceScehduler
- เพิ่มไฟล์
Build.yml
สำหรับ Build และ Release โดยเก็บไว้ในโฟลเดอร์.github/workflows
- Commit โค้ดไปยัง GitHub
git init
git remote add origin <URI>git commit -m "Message"
git push origin master
- Tag เลขเวอร์ชัน
git tag v0.0.4
git push origin v0.0.4
- รอจนกว่า GitHub Actions จะทำงานเสร็จ จะได้ผลลัทธ์เป็น Release ที่มีไฟล์แนบ คือ
ServiceScheduler.v0.0.4.zip