Skip to content

Commit 285acd7

Browse files
committed
Simplify release workflow.
1 parent 7ce0efc commit 285acd7

5 files changed

Lines changed: 175 additions & 1166 deletions

File tree

.github/actions/get-versions/action.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ outputs:
1717
driver_available:
1818
description: 'Whether a compatible driver was found (true/false)'
1919
value: ${{ steps.driver.outputs.available }}
20+
nuget_version:
21+
description: 'Latest Patchright .NET version published on NuGet.org'
22+
value: ${{ steps.nuget.outputs.version }}
23+
nuget_versions:
24+
description: 'All Patchright .NET versions published on NuGet.org (JSON array)'
25+
value: ${{ steps.nuget.outputs.versions }}
2026

2127
runs:
2228
using: 'composite'
@@ -88,3 +94,29 @@ runs:
8894
echo "version=" >> $GITHUB_OUTPUT
8995
echo "available=false" >> $GITHUB_OUTPUT
9096
fi
97+
98+
- name: Get NuGet.org published versions
99+
id: nuget
100+
shell: bash
101+
run: |
102+
echo "Fetching Patchright .NET versions from NuGet.org..."
103+
104+
# Query NuGet API for all published versions
105+
RESPONSE=$(curl -s "https://api.nuget.org/v3-flatcontainer/patchright/index.json" || echo '{"versions":[]}')
106+
107+
# Check if we got a valid response
108+
if echo "$RESPONSE" | jq -e '.versions' > /dev/null 2>&1; then
109+
# Get all versions as JSON array
110+
VERSIONS=$(echo "$RESPONSE" | jq -c '.versions')
111+
112+
# Get the latest version (last in the sorted array)
113+
LATEST=$(echo "$RESPONSE" | jq -r '.versions[-1] // ""')
114+
115+
echo "Latest NuGet version: $LATEST"
116+
echo "version=$LATEST" >> $GITHUB_OUTPUT
117+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
118+
else
119+
echo "No Patchright .NET versions found on NuGet.org"
120+
echo "version=" >> $GITHUB_OUTPUT
121+
echo "versions=[]" >> $GITHUB_OUTPUT
122+
fi

0 commit comments

Comments
 (0)