-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·39 lines (31 loc) · 1 KB
/
Copy pathpublish.sh
File metadata and controls
executable file
·39 lines (31 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Exit on error
set -e
if [ "$#" -lt 2 ]; then
echo "Usage: ./publish.sh <Version> <ApiKey> [Configuration]"
exit 1
fi
VERSION=$1
API_KEY=$2
CONFIGURATION=${3:-"Release"}
PLUGIN_ID="ReSharperPlugin.AutoMapper.FindUsage"
OUTPUT_DIR="$(pwd)/output"
SOLUTION="ReSharperPlugin.AutoMapper.FindUsage.sln"
# Extract latest changelog section (simplistic version)
CHANGELOG=$(sed -n '/^## \[/,/^## \[/{ /^## \[/!p; }' CHANGELOG.md | head -n 20)
echo "Publishing $PLUGIN_ID version $VERSION..."
dotnet build "$SOLUTION" \
-c "$CONFIGURATION" \
-p:PackageVersion="$VERSION" \
-p:PackageOutputPath="$OUTPUT_DIR" \
-p:PackageReleaseNotes="$CHANGELOG" \
/t:Restore,Rebuild,Pack \
-v minimal
PACKAGE_FILE=$(ls $OUTPUT_DIR/$PLUGIN_ID.$VERSION.nupkg)
if [ -f "$PACKAGE_FILE" ]; then
echo "Pushing $PACKAGE_FILE..."
dotnet nuget push "$PACKAGE_FILE" -s "https://plugins.jetbrains.com/api/v2/package" -k "$API_KEY"
else
echo "Error: Package file $PACKAGE_FILE not found."
exit 1
fi