diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 3e960cd..13ef71d 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -12,6 +12,7 @@ on:
env:
DOTNET_VERSION: "10.x"
+ NUGET_PACKAGE_NAME: "ClosureOSS.WebPush"
permissions:
contents: write
@@ -22,7 +23,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v6
+ - name: Checkout code
+ uses: actions/checkout@v6
with:
fetch-depth: 0
@@ -31,19 +33,17 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
cache: true
- cache-dependency-path: "**/packages.lock.json"
-
- - name: Restore dependencies
- run: dotnet restore --locked-mode
+ cache-dependency-path: '**/packages.lock.json'
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.5.0
- name: Determine Version
- id: gitversion
+ id: meta
uses: gittools/actions/gitversion/execute@v4.5.0
- with:
- updateProjectFiles: true
+
+ - name: Restore dependencies
+ run: dotnet restore --locked-mode
- name: Build
run: dotnet build --no-restore -c Release
@@ -54,6 +54,6 @@ jobs:
- name: Upload Nuget package as Artifact
uses: actions/upload-artifact@v6
with:
- name: ClosureOSS.WebPush.${{ steps.gitversion.outputs.FullSemVer }}
+ name: ${{ env.NUGET_PACKAGE_NAME }}.${{ steps.meta.outputs.SemVer }}
path: ./artifacts/package/release/*nupkg
retention-days: 1
diff --git a/.github/workflows/release-nuget.yml b/.github/workflows/release-nuget.yml
index b793012..ebcad0f 100644
--- a/.github/workflows/release-nuget.yml
+++ b/.github/workflows/release-nuget.yml
@@ -1,6 +1,7 @@
name: 🎁 Publish nuget package
on:
+ workflow_dispatch:
push:
tags:
- "v[0-9]*.[0-9]*.[0-9]*" # Pattern for standard: v1.2.3
@@ -14,7 +15,7 @@ permissions:
pull-requests: read
jobs:
- publish:
+ release:
runs-on: ubuntu-latest
environment: public-release
@@ -31,17 +32,15 @@ jobs:
cache: true
cache-dependency-path: '**/packages.lock.json'
- - name: Restore dependencies
- run: dotnet restore --locked-mode
-
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v4.5.0
- name: Determine Version
- id: gitversion
+ id: meta
uses: gittools/actions/gitversion/execute@v4.5.0
- with:
- updateProjectFiles: true
+
+ - name: Restore dependencies
+ run: dotnet restore --locked-mode
- name: Build
run: dotnet build --no-restore -c Release
@@ -55,11 +54,12 @@ jobs:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}
- name: Create Release
- id: create_release
uses: softprops/action-gh-release@v3
with:
- tag_name: ${{ github.ref_name }}
- name: "${{ github.ref_name }}"
+ tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}', steps.meta.outputs.SemVer) }}
+ name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}', steps.meta.outputs.SemVer) }}
generate_release_notes: true
- files: ./artifacts/package/release/*nupkg
- prerelease: ${{ steps.gitversion.outputs.PreReleaseTag != '' }}
+ target_commitish: ${{ github.sha }}
+ draft: false
+ prerelease: ${{ steps.meta.outputs.PreReleaseTag != '' }}
+ make_latest: ${{ steps.meta.outputs.PreReleaseTag == '' }}
diff --git a/GitVersion.yaml b/GitVersion.yaml
index e611680..bf21a15 100644
--- a/GitVersion.yaml
+++ b/GitVersion.yaml
@@ -1,5 +1,10 @@
workflow: GitHubFlow/v1
mode: ContinuousDelivery
branches:
+ main:
+ label: "beta"
feature:
mode: ContinuousDelivery
+assembly-versioning-format: '{MajorMinorPatch}.{WeightedPreReleaseNumber}'
+assembly-file-versioning-format: '{MajorMinorPatch}.{WeightedPreReleaseNumber}'
+assembly-informational-format: '{MajorMinorPatch}.{WeightedPreReleaseNumber}'
\ No newline at end of file
diff --git a/WebPush/WebPush.csproj b/WebPush/WebPush.csproj
index bc69bb2..464c1b7 100755
--- a/WebPush/WebPush.csproj
+++ b/WebPush/WebPush.csproj
@@ -33,7 +33,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
all
diff --git a/WebPush/packages.lock.json b/WebPush/packages.lock.json
index 7f674d8..b2ee150 100644
--- a/WebPush/packages.lock.json
+++ b/WebPush/packages.lock.json
@@ -10,9 +10,9 @@
},
"Meziantou.Analyzer": {
"type": "Direct",
- "requested": "[3.0.61, )",
- "resolved": "3.0.61",
- "contentHash": "Ed/5bKmY38QbQJgL9wmWnweX4mq3WaNYNq8kp4Hk/WPIFuLuK/P/dEB/ZnenQius+NNDXxTIiCXFPmQdLrHWMg=="
+ "requested": "[3.0.63, )",
+ "resolved": "3.0.63",
+ "contentHash": "WHkfz41Kilygfto/ABn2Q3/7xVTpxM5D74d8nJSzA4oAucACa4itSjfEh5lyvEoCRg8BvuyalD+A99GORTbjsw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
@@ -76,9 +76,9 @@
},
"Meziantou.Analyzer": {
"type": "Direct",
- "requested": "[3.0.61, )",
- "resolved": "3.0.61",
- "contentHash": "Ed/5bKmY38QbQJgL9wmWnweX4mq3WaNYNq8kp4Hk/WPIFuLuK/P/dEB/ZnenQius+NNDXxTIiCXFPmQdLrHWMg=="
+ "requested": "[3.0.63, )",
+ "resolved": "3.0.63",
+ "contentHash": "WHkfz41Kilygfto/ABn2Q3/7xVTpxM5D74d8nJSzA4oAucACa4itSjfEh5lyvEoCRg8BvuyalD+A99GORTbjsw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",
@@ -148,9 +148,9 @@
},
"Meziantou.Analyzer": {
"type": "Direct",
- "requested": "[3.0.61, )",
- "resolved": "3.0.61",
- "contentHash": "Ed/5bKmY38QbQJgL9wmWnweX4mq3WaNYNq8kp4Hk/WPIFuLuK/P/dEB/ZnenQius+NNDXxTIiCXFPmQdLrHWMg=="
+ "requested": "[3.0.63, )",
+ "resolved": "3.0.63",
+ "contentHash": "WHkfz41Kilygfto/ABn2Q3/7xVTpxM5D74d8nJSzA4oAucACa4itSjfEh5lyvEoCRg8BvuyalD+A99GORTbjsw=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Direct",