Skip to content

Commit 33f86d1

Browse files
committed
feat: add support for releasing repos without package.json
1 parent 8a020ea commit 33f86d1

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/release-post-merge.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,17 @@ jobs:
110110
git merge origin/${{ inputs.base_branch }}
111111
git push origin ${{ inputs.develop_branch }}
112112
113+
- name: check for package.json
114+
id: check-package-json
115+
run: |
116+
if [ -f "package.json" ]; then
117+
echo "is_package_json=true" >> "$GITHUB_OUTPUT"
118+
else
119+
echo "is_package_json=false" >> "$GITHUB_OUTPUT"
120+
fi
121+
113122
- name: Update Package Version for Next Development Cycle
123+
if: ${{ steps.check-package-json.outputs.is_package_json == 'true' }}
114124
run: |
115125
git config user.name "$GITHUB_USER"
116126
git config user.email "<>"

.github/workflows/release-source.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,17 @@ jobs:
8181
actor: ${{ github.actor }}
8282
qms_are_allowed: "false"
8383

84+
- name: check for package.json
85+
id: check-package-json
86+
run: |
87+
if [ -f "package.json" ]; then
88+
echo "is_package_json=true" >> "$GITHUB_OUTPUT"
89+
else
90+
echo "is_package_json=false" >> "$GITHUB_OUTPUT"
91+
fi
92+
8493
- name: get release version from input
85-
if: ${{ inputs.skip_branch_check == false }}
94+
if: ${{ inputs.skip_branch_check == false && steps.check-package-json.outputs.is_package_json == 'true' }}
8695
id: get-release-version-from-input
8796
run: |
8897
input_release_version="${{ inputs.release_version }}"
@@ -136,6 +145,7 @@ jobs:
136145
git config user.email "<>"
137146
git checkout -b release-"$RELEASE_VERSION"
138147
- name: Update package.json
148+
if: ${{ steps.check-package-json.outputs.is_package_json == 'true' }}
139149
run: |
140150
sed -i "s/^\(\s*\)\"version\".*/\1\"version\": \"$RELEASE_VERSION\",/" package.json
141151
git add package.json
@@ -225,7 +235,7 @@ jobs:
225235
git add .
226236
- name: Commit changes
227237
run: |
228-
git commit -m "Prepare release version $RELEASE_VERSION"
238+
git commit --allow-empty -m "Prepare release version $RELEASE_VERSION"
229239
- name: push all changes
230240
run: |
231241
git push origin release-"$RELEASE_VERSION"

0 commit comments

Comments
 (0)