Skip to content

Commit

Permalink
Improved ci with auto release generation
Browse files Browse the repository at this point in the history
  • Loading branch information
distantcam committed Jul 25, 2024
1 parent 93fd7e2 commit f2e33ca
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 37 deletions.
11 changes: 11 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
changelog:
categories:
- title: 🏕 Features
labels:
- "*"
exclude:
labels:
- dependencies
- title: 👒 Dependencies
labels:
- dependencies
79 changes: 42 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,17 @@ on:
- main

jobs:
build:
name: 🛠️ Build
runs-on: ubuntu-latest
steps:
- name: 👨‍💻 Check-out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 👨‍🔧 Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json

- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"

- name: 🎒 Load packages
run: dotnet restore

- name: 🛠️ Build code
run: dotnet build --configuration Release --no-restore

test:
name: 🧪 Run tests
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
roslyn: ["3.11", "4.4", "4.6", "4.8", "4.10"]
steps:
- name: 👨‍💻 Check-out code
- name: 🛒 Check-out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 👨‍🔧 Setup .NET Core SDK
- name: 📐 Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json
Expand All @@ -67,26 +41,23 @@ jobs:
--
RunConfiguration.CollectSourceInformation=true
publish:
name: 📦 Publish nuget library
build:
name: 🛠️ Build
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: [build]
steps:
- name: 👨‍💻 Check-out code
- name: 🛒 Check-out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 👨‍🔧 Setup .NET Core SDK
- name: 📐 Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: src/global.json

- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"

- name: 🎒 Load packages
- name: 🔧 Load packages
run: dotnet restore

- name: 🛠️ Build code
Expand All @@ -98,5 +69,39 @@ jobs:
name: nuget
path: nugets/*.nupkg

publish:
name: 📦 Publish nuget library
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: [test, build]
steps:
- name: 📦 Download Artifact
uses: actions/download-artifact@v4
with:
name: nuget

- name: ✈️ Push Nuget
run: dotnet nuget push nugets/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate

create-release:
name: 📝 Create GitHub Release
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
needs: [test, build]
permissions:
contents: write
steps:
- name: 📦 Download Artifact
uses: actions/download-artifact@v4
with:
name: nuget

- name: 📝 Generate Release Notes
run: gh release create ${{ github.ref }} --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 📦 Upload Release Asset
run: gh release upload ${{ github.ref }} *.nupkg
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f2e33ca

Please sign in to comment.