@anddone/adminportaltestautomation 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,15 +44,23 @@ jobs:
|
|
|
44
44
|
# 6. Bump version safely
|
|
45
45
|
- name: Bump version
|
|
46
46
|
run: |
|
|
47
|
+
# Get release type (patch/minor/major)
|
|
47
48
|
RELEASE_TYPE=${{ inputs.release_type }}
|
|
49
|
+
|
|
50
|
+
# Get current version
|
|
48
51
|
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
|
52
|
+
|
|
53
|
+
# Calculate new version without tagging yet
|
|
49
54
|
NEW_VERSION=$(npm version $RELEASE_TYPE --no-git-tag-version)
|
|
55
|
+
|
|
50
56
|
echo "Current version: $CURRENT_VERSION"
|
|
51
57
|
echo "New version: $NEW_VERSION"
|
|
58
|
+
|
|
59
|
+
# Commit package.json changes
|
|
52
60
|
git add package.json
|
|
53
61
|
git commit -m "chore(release): $NEW_VERSION"
|
|
54
62
|
|
|
55
|
-
# Delete tag if exists
|
|
63
|
+
# Delete tag if it already exists to avoid CI errors
|
|
56
64
|
if git rev-parse "v$NEW_VERSION" >/dev/null 2>&1; then
|
|
57
65
|
git tag -d "v$NEW_VERSION"
|
|
58
66
|
git push origin :refs/tags/v$NEW_VERSION
|
|
@@ -60,7 +68,9 @@ jobs:
|
|
|
60
68
|
|
|
61
69
|
# Create new tag
|
|
62
70
|
git tag "v$NEW_VERSION"
|
|
63
|
-
|
|
71
|
+
|
|
72
|
+
# Force push branch and tags safely
|
|
73
|
+
git push --force-with-lease origin master --tags
|
|
64
74
|
|
|
65
75
|
# 7. Publish to npm
|
|
66
76
|
- name: Publish to npm
|
|
@@ -72,20 +82,11 @@ jobs:
|
|
|
72
82
|
- name: Slack Success
|
|
73
83
|
if: success()
|
|
74
84
|
run: |
|
|
75
|
-
PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
76
85
|
VERSION=$(node -p "require('./package.json').version")
|
|
77
|
-
# Read release notes from file (multiline supported)
|
|
78
|
-
if [ -f release-note.txt ]; then
|
|
79
|
-
RELEASE_NOTES=$(sed ':a;N;$!ba;s/\n/\\n• /g' release-note.txt)
|
|
80
|
-
RELEASE_NOTES="• $RELEASE_NOTES"
|
|
81
|
-
else
|
|
82
|
-
RELEASE_NOTES="• No release notes provided"
|
|
83
|
-
fi
|
|
84
|
-
|
|
85
86
|
curl -X POST -H 'Content-type: application/json' \
|
|
86
87
|
--data "{
|
|
87
|
-
\"username\": \"
|
|
88
|
-
\"text\": \":white_check_mark: npm package published!\n*
|
|
88
|
+
\"username\": \"AdminPortalTestAutomation\",
|
|
89
|
+
\"text\": \":white_check_mark: npm package published!\n*Version:* $VERSION\n*Notes:*\n• Added fileCommonUtils\n• File handling methods\n• Supports text, XLSX, JSON\"
|
|
89
90
|
}" \
|
|
90
91
|
${{ secrets.SLACK_WEBHOOK_URL }}
|
|
91
92
|
|