Skip to content

Commit 083c4b4

Browse files
GitHub Action - Beta/Pre-release support
1 parent b0a3fa7 commit 083c4b4

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ name: Deploy to NuGet
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to deploy to'
8+
required: true
9+
default: 'production'
10+
type: choice
11+
options:
12+
- production
13+
- beta
514

615
jobs:
716
deploy:
@@ -10,7 +19,7 @@ jobs:
1019
contents: write
1120
packages: write
1221
id-token: write
13-
environment: production
22+
environment: ${{ github.event.inputs.environment }}
1423
steps:
1524
- uses: actions/checkout@v4
1625
with:
@@ -28,6 +37,12 @@ jobs:
2837
VERSION=$(grep -oP '(?<=<Version>).*?(?=</Version>)' EntityFrameworkCore.Sqlite.Concurrency/EFCore.Sqlite.Concurrency.csproj)
2938
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
3039
echo "Detected version: $VERSION"
40+
41+
if [[ $VERSION == *"-"* ]] || [[ "${{ github.event.inputs.environment }}" == "beta" ]]; then
42+
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
43+
else
44+
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT
45+
fi
3146
3247
- name: Restore dependencies
3348
run: dotnet restore EntityFrameworkCore.Sqlite.Concurrency/EFCore.Sqlite.Concurrency.csproj
@@ -45,7 +60,7 @@ jobs:
4560
tag_name: v${{ steps.get_version.outputs.VERSION }}
4661
name: Release v${{ steps.get_version.outputs.VERSION }}
4762
draft: false
48-
prerelease: false
63+
prerelease: ${{ steps.get_version.outputs.IS_PRERELEASE == 'true' }}
4964
files: |
5065
out/*.nupkg
5166
out/*.snupkg

0 commit comments

Comments
 (0)