Skip to content

Commit 4b7c88f

Browse files
committed
fixing empty asset zip
1 parent f8562af commit 4b7c88f

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

.github/workflows/release.yaml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
outputs:
2222
current: ${{ steps.version_check.outputs.current }}
2323
new: ${{ steps.version_check.outputs.new }}
24+
files: ${{ steps.file_check.outputs.files }}
2425
steps:
2526
- name: "checkout"
2627
uses: actions/checkout@v3
@@ -148,6 +149,23 @@ jobs:
148149
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
149150
echo "new=$VERSION" >> $GITHUB_OUTPUT
150151
152+
# 3. create release archive
153+
## exclude certain files from release archive
154+
- name: "check files"
155+
id: file_check
156+
run: |
157+
LS=$(ls)
158+
FILES=()
159+
for ITEM in $LS; do
160+
if [[ ! $ITEM = "CHANGELOG.md" ]] &&
161+
[[ ! $ITEM = "CITATION.cff" ]] &&
162+
[[ ! $ITEM = "CODE_OF_CONDUCT.md" ]] &&
163+
[[ ! $ITEM = "CONTRIBUTING.md" ]]; then
164+
FILES=${FILES:+$FILES }$ITEM
165+
fi
166+
done
167+
echo "files=$FILES" >> $GITHUB_OUTPUT
168+
151169
create_package:
152170
name: "create package"
153171
needs: [version]
@@ -170,7 +188,7 @@ jobs:
170188
## ---------------------------------
171189
TOP=$(grep -n "## \[Unreleased\]" CHANGELOG.md | cut -d: -f1)
172190
if [ "$CURRENT_VERSION" = "no_version" ]; then
173-
BOTTOM=$(grep -n -m 1 "\[Unreleased\]: https://github.com/${{ env.ACCOUNT_NAME }}/" CHANGELOG.md | cut -d: -f1)
191+
BOTTOM=$(grep -n -m 1 "\[Unreleased\]: https://github.com/" CHANGELOG.md | cut -d: -f1)
174192
else
175193
BOTTOM=$(grep -n -m 1 "## Version \[$CURRENT_VERSION\]" CHANGELOG.md | cut -d: -f1)
176194
fi
@@ -195,23 +213,10 @@ jobs:
195213
## ---------------------------------
196214
sed -i -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' release-note-v$NEW_VERSION.md
197215
198-
# 3. create release archive
199-
## exclude certain files from release archive
200-
- run: |
201-
LS=$(ls)
202-
FILES=()
203-
for ITEM in $LS; do
204-
if [[ ! $ITEM = "CHANGELOG.md" ]] &&
205-
[[ ! $ITEM = "CITATION.cff" ]] &&
206-
[[ ! $ITEM = "CODE_OF_CONDUCT.md" ]] &&
207-
[[ ! $ITEM = "CONTRIBUTING.md" ]]; then
208-
FILES=${FILES:+$FILES }$ITEM
209-
fi
210-
done
211216
- name: "create release archive"
212217
uses: papeloto/action-zip@v1.1
213218
with:
214-
files: $FILES
219+
files: ${{ needs.version.outputs.files }}
215220
recursive: false
216221
dest: ${{ env.REPO_NAME }}-v${{ needs.version.outputs.new }}.zip
217222
- run: echo "- creating ZIP-Archive for the new release :white_check_mark:" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)