WIP: CI: Add a script to automatically build, test and release the Module. #1
19
.gitea/workflows/ci.yml
Normal file
19
.gitea/workflows/ci.yml
Normal 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
|
33
.gitea/workflows/release.yml
Normal file
33
.gitea/workflows/release.yml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user