Skip to content

Commit

Permalink
Fixed creation of release notes #63
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Oct 30, 2023
1 parent cbaa6ef commit 500ac87
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
ref: ${{ needs.prepare.outputs.tag }}
fetch-depth: 0

- name: Lint
Expand Down
60 changes: 40 additions & 20 deletions scripts/release-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,78 @@ TAG="$(
git tag \
| tail -n 1
)"
PREVIOUS_TAG="$(
git tag \
| tail -n 2 \
| head -n 1
PREVIOUS_TAGS="$(
git tag --list v* \
| head -n -1 \
| sort -Vr
)"

TIMESTAMP="$(
gh release view "${PREVIOUS_TAG}" --json=publishedAt --template='{{.publishedAt}}'
)"
for PREVIOUS_TAG in ${PREVIOUS_TAGS}; do
echo "Testing previous tag: ${PREVIOUS_TAG}" >&2

if \
TIMESTAMP="$(
gh release view "${PREVIOUS_TAG}" --json=publishedAt --template='{{.publishedAt}}'
)"; then
break
fi
done
if test -z "${TIMESTAMP}"; then
echo "ERROR: Unable to find previous release of ${TAG}. Candidates: ${PREVIOUS_TAGS}." >&2
exit 1
fi
echo "Found timestamp: ${TIMESTAMP}" >&2

cat <<EOF
## Installation
```bash
curl -sSLf https://github.com/uniget-org/cli/releases/download/${TAG}/uniget_linux_\$(uname -m).tar.gz \
\`\`\`bash
curl -sSLf https://github.com/uniget-org/cli/releases/download/${TAG}/uniget_linux_\$(uname -m).tar.gz \\
| sudo tar -xzC /usr/local/bin uniget
```
\`\`\`
### Signature verification
## Signature verification
```bash
\`\`\`bash
curl -sSLfO https://github.com/uniget-org/cli/releases/download/${TAG}/uniget_linux_\$(uname -m).tar.gz
curl -sSLfO https://github.com/uniget-org/cli/releases/download/${TAG}/uniget_linux_\$(uname -m).tar.gz.pem
curl -sSLfO https://github.com/uniget-org/cli/releases/download/${TAG}/uniget_linux_\$(uname -m).tar.gz.sig
cosign verify-blob uniget_linux_\$(uname -m).tar.gz \
--certificate uniget_linux_\$(uname -m).tar.gz.pem \
--signature uniget_linux_\$(uname -m).tar.gz.sig \
--certificate-identity 'https://github.com/uniget-org/cli/.github/workflows/release.yml@refs/tags/${TAG}' \
cosign verify-blob uniget_linux_\$(uname -m).tar.gz \\
--certificate uniget_linux_\$(uname -m).tar.gz.pem \\
--signature uniget_linux_\$(uname -m).tar.gz.sig \\
--certificate-identity 'https://github.com/uniget-org/cli/.github/workflows/release.yml@refs/tags/${TAG}' \\
--certificate-oidc-issuer https://token.actions.githubusercontent.com
```
\`\`\`
EOF

echo "## Bugs fixed"
echo
echo "## Bugfixes"
echo
gh issue list \
--search="state:closed closed:>${TIMESTAMP} label:bug -label:wontfix" \
--json=number,title,url \
--template='{{range .}}- {{.title}} ({{hyperlink .url (printf "#%v" .number)}}){{"\n"}}{{end}}'

echo "## Enhancements added"
echo
echo "## Features"
echo
gh issue list \
--search="state:closed closed:>${TIMESTAMP} label:enhancement -label:wontfix" \
--json=number,title,url \
--template='{{range .}}- {{.title}} ({{hyperlink .url (printf "#%v" .number)}}){{"\n"}}{{end}}'

echo "## Dependencies updated"
echo
echo "## Dependency updates"
echo
gh pr list \
--state=merged \
--search="merged:>${TIMESTAMP} label:type/renovate" \
--json=number,title,url \
--template='{{range .}}- {{.title}} ({{hyperlink .url (printf "#%v" .number)}}){{"\n"}}{{end}}'

echo
cat <<EOF
## Full Changelog
[Compare with previous release](https://github.com/uniget-org/cli/compare/${PREVIOUS_TAG}...${TAG})
EOF

0 comments on commit 500ac87

Please sign in to comment.