Skip to content

Commit ab1c92a

Browse files
authored
Update release.yml
1 parent 4c5c04e commit ab1c92a

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- major
1313
default: minor
1414
workflow_run:
15+
branches: [master]
1516
workflows: ["Tests"]
1617
types: [completed]
1718

@@ -154,6 +155,7 @@ jobs:
154155
jq --arg v "$new" '.version=$v' "$PACKAGE_JSON" > "$tmp"
155156
mv "$tmp" "$PACKAGE_JSON"
156157
158+
echo "old=$current" >> "$GITHUB_OUTPUT"
157159
echo "new=$new" >> "$GITHUB_OUTPUT"
158160
159161
- name: Commit and tag
@@ -208,9 +210,25 @@ jobs:
208210
209211
notes="release-notes.md"
210212
{
211-
echo "# v${{ steps.ver.outputs.new }}"
212-
echo "This is an automatic rolling release."
213-
echo "#### The latest changes that went into this release:"
213+
echo "This is a rolling release - it is automatically updated to the latest release tag."
214+
echo "Release tags are created automatically when pushed commits pass all tests."
215+
216+
echo "Installation"
217+
echo "--------------"
218+
echo "Compatibility: ***Unity 2022.3.12f1 or newer***"
219+
echo ""
220+
echo "Recommended method:"
221+
echo "- Window ⟶ Package Manager ⟶ `+` ⟶ "Install package from git URL"
222+
echo "- Paste the URL (the `release` branch which points at last the commit with all tests passing)"
223+
echo "```"x`
224+
echo "--------------------------------------------"
225+
echo ""
226+
echo "https://github.com/apkd/Medicine.git#release"
227+
echo ""
228+
echo "--------------------------------------------"
229+
echo "```"
230+
echo "Latest changes"
231+
echo "--------------"
214232
echo
215233
echo '| Author | Release | Commit | SHA |'
216234
echo '|---|---|---|---|'
@@ -222,14 +240,14 @@ jobs:
222240
mapfile -t rel_tags < <(git for-each-ref --sort=creatordate --format='%(refname:short)' refs/tags | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)
223241

224242
git log -n 24 "$upper" --pretty=format:%H%x09%s%x09%an%x09%ae | \
225-
while IFS=$'\t' read -r sha msg author email; do
226243
lc_author="$(printf '%s' "$author" | tr '[:upper:]' '[:lower:]')"
227244
lc_email="$(printf '%s' "$email" | tr '[:upper:]' '[:lower:]')"
228245
if [[ "$lc_author" == "github-actions[bot]" || "$lc_email" == "41898282+github-actions[bot]@users.noreply.github.com" ]]; then
229246
continue
230247
fi
231248

232249
short="${sha:0:7}"
250+
link=$'<a href="https://github.com/${{ github.repository }}/commit/$sha">$short</a>'
233251
msg="${msg//|/\\|}"
234252

235253
new_prefix=""
@@ -272,21 +290,25 @@ jobs:
272290
done
273291
version="${new_prefix}${version}"
274292

275-
printf '| %s | %s | %s | `%s` |\n' "$author_cell" "$version" "$msg" "$short" >> "$notes"
293+
printf '| %s | %s | %s | `%s` |\n' "$author_cell" "$version" "$msg" "$shortlink" >> "$notes"
276294

277295
count=$((count+1))
278296
if [[ $count -ge $limit ]]; then
279297
break
280298
fi
281299
done
282-
300+
301+
printf '| | | View [diff](github.com/${{ github.repository }}/compare/v${{ steps.ver.outputs.old }}...latest)), [all recent commits](https://github.com/${{ github.repository }}/commits/master/) | |' >> "$notes"
302+
printf '' >> "$notes"
303+
printf '' >> "$notes"
304+
283305
git tag -fa "$tag" "$upper" -m "Latest rolling release"
284306
git push -f origin "refs/tags/$tag"
285307

286308
if gh release view "$tag" >/dev/null 2>&1; then
287-
gh release edit "$tag" --notes-file "$notes" --title "$tag" --latest
309+
gh release edit "$tag" --notes-file "$notes" --title "v${{ steps.ver.outputs.new }}" --latest
288310
else
289-
gh release create "$tag" --title "$tag" --notes-file "$notes" --target "$upper" --latest
311+
gh release create "$tag" --title "v${{ steps.ver.outputs.new }}" --notes-file "$notes" --target "$upper" --latest
290312
fi
291313

292314
{
@@ -300,4 +322,4 @@ jobs:
300322
shell: bash
301323
run: |
302324
set -euo pipefail
303-
git push -f origin HEAD:refs/heads/release
325+
git push -f origin HEAD:refs/heads/release

0 commit comments

Comments
 (0)