-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (29 loc) · 1.2 KB
/
Copy pathci-dotnet.yaml
File metadata and controls
35 lines (29 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: dotnet CI build
on: push
jobs:
donet-ci-build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
source-url: https://nuget.pkg.github.com/BluEye-Robotics/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Sanitize branch name
id: branches
run: |
BRANCH="${GITHUB_REF_NAME}"
SANITIZED=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9]/-/g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//' | tr '[:upper:]' '[:lower:]' | cut -c1-63)
echo "sanitized-branch-name=$SANITIZED" >> "$GITHUB_OUTPUT"
- name: Build project and generate NuGet package
run: |
dotnet pack Blueye.Protocol.Protobuf.csproj --version-suffix "${{ steps.branches.outputs.sanitized-branch-name }}.$GITHUB_RUN_NUMBER" -c Release -o out
- name: Push generated package to GitHub registry
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: dotnet nuget push ./out/*.nupkg --skip-duplicate --no-symbols --api-key $NUGET_AUTH_TOKEN