Update .forgejo/workflows/release.yml
Some checks failed
Release / release (push) Failing after 3m31s
Some checks failed
Release / release (push) Failing after 3m31s
This commit is contained in:
parent
508662ee86
commit
6060a7d85a
1 changed files with 50 additions and 49 deletions
|
@ -53,6 +53,56 @@ jobs:
|
|||
git commit -am "Release ${{ steps.version.outputs.release_version }}"
|
||||
git push
|
||||
|
||||
# Create the release notes (closed issues)
|
||||
# Must be here, before the new tag, to get closed issued from the LAST TAG to NOW
|
||||
- name: Generate release notes from closed issues
|
||||
id: generate_notes
|
||||
run: |
|
||||
REPO_OWNER="root"
|
||||
REPO_NAME="resilient"
|
||||
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
|
||||
VERSION="${{ steps.version.outputs.release_version }}"
|
||||
API_BASE="https://git.oguerreiro.com/api/v1"
|
||||
|
||||
echo "Fetching latest release tag..."
|
||||
LATEST_TAG=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/tags" \
|
||||
| jq -r '.[0].name')
|
||||
|
||||
if [[ -z "$LATEST_TAG" || "$LATEST_TAG" == "null" ]]; then
|
||||
echo "No previous tags found. Assuming first release."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
echo "Latest tag is: $LATEST_TAG"
|
||||
|
||||
# Get ISO timestamp of the latest tag commit
|
||||
COMMIT_DATE=$(git log -1 --format=%cI "$LATEST_TAG")
|
||||
echo "Fetching closed issues since $COMMIT_DATE..."
|
||||
|
||||
CLOSED_ISSUES_JSON=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/issues?state=closed&since=$COMMIT_DATE")
|
||||
|
||||
if [[ -z "$CLOSED_ISSUES_JSON" ]]; then
|
||||
echo "Warning: No closed issues or invalid response."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
CLOSED_ISSUES=$(echo "$CLOSED_ISSUES_JSON" | jq -r '.[] | "- [#\(.number)](\(.html_url)) \(.title)"')
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build release notes markdown
|
||||
{
|
||||
echo "## Release v$VERSION"
|
||||
echo
|
||||
if [[ -n "$CLOSED_ISSUES" ]]; then
|
||||
echo "### Closed Issues"
|
||||
echo "$CLOSED_ISSUES"
|
||||
else
|
||||
echo "No issues closed since last release."
|
||||
fi
|
||||
} > release-notes.md
|
||||
cat release-notes.md
|
||||
|
||||
- name: Tag release
|
||||
run: |
|
||||
git tag -a v${{ steps.version.outputs.release_version }} -m "Release ${{ steps.version.outputs.release_version }}"
|
||||
|
@ -106,55 +156,6 @@ jobs:
|
|||
name: app-backend
|
||||
path: target/resilient*.jar
|
||||
|
||||
# Create the release notes (closed issues)
|
||||
- name: Generate release notes from closed issues
|
||||
id: generate_notes
|
||||
run: |
|
||||
REPO_OWNER="root"
|
||||
REPO_NAME="resilient"
|
||||
TOKEN="${{ secrets.FORGEJO_TOKEN }}"
|
||||
VERSION="${{ steps.version.outputs.release_version }}"
|
||||
API_BASE="https://git.oguerreiro.com/api/v1"
|
||||
|
||||
echo "Fetching latest release tag..."
|
||||
LATEST_TAG=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/tags" \
|
||||
| jq -r '.[0].name')
|
||||
|
||||
if [[ -z "$LATEST_TAG" || "$LATEST_TAG" == "null" ]]; then
|
||||
echo "No previous tags found. Assuming first release."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
echo "Latest tag is: $LATEST_TAG"
|
||||
|
||||
# Get ISO timestamp of the latest tag commit
|
||||
COMMIT_DATE=$(git log -1 --format=%cI "$LATEST_TAG")
|
||||
echo "Fetching closed issues since $COMMIT_DATE..."
|
||||
|
||||
CLOSED_ISSUES_JSON=$(curl -sf -H "Authorization: token $TOKEN" \
|
||||
"$API_BASE/repos/$REPO_OWNER/$REPO_NAME/issues?state=closed&since=$COMMIT_DATE")
|
||||
|
||||
if [[ -z "$CLOSED_ISSUES_JSON" ]]; then
|
||||
echo "Warning: No closed issues or invalid response."
|
||||
CLOSED_ISSUES=""
|
||||
else
|
||||
CLOSED_ISSUES=$(echo "$CLOSED_ISSUES_JSON" | jq -r '.[] | "- [#\(.number)](\(.html_url)) \(.title)"')
|
||||
fi
|
||||
fi
|
||||
|
||||
# Build release notes markdown
|
||||
{
|
||||
echo "## Release v$VERSION"
|
||||
echo
|
||||
if [[ -n "$CLOSED_ISSUES" ]]; then
|
||||
echo "### Closed Issues"
|
||||
echo "$CLOSED_ISSUES"
|
||||
else
|
||||
echo "No issues closed since last release."
|
||||
fi
|
||||
} > release-notes.md
|
||||
cat release-notes.md
|
||||
|
||||
# Create the release
|
||||
# NOTE: added system dependency install "jq"
|
||||
- name: Create release and upload JAR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue