Add CI scripts to build the module automatically

This commit is contained in:
Konstantin Hintermayer 2025-05-14 21:07:34 +02:00
parent 38c5bef225
commit 02a845c711
2 changed files with 52 additions and 0 deletions

19
.gitea/workflows/ci.yml Normal file
View File

@ -0,0 +1,19 @@
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --configuration Release --no-build

View File

@ -0,0 +1,33 @@
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set VERSION variable from tag
run: echo "VERSION=${GITEA_REF/refs\/tags\/v/}" >> $GITEA_ENV
- name: Build
run: dotnet build --configuration Release /p:Version=${VERSION}
- name: Test
run: dotnet test --configuration Release /p:Version=${VERSION} --no-build
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output .
- uses: https://github.com/actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
retention-days: 7
path: ./*.nupkg