35 lines
1.1 KiB
YAML
35 lines
1.1 KiB
YAML
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: Setup Dotnet SDK
|
|
uses: https://github.com/actions/setup-dotnet@v4
|
|
- 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 |