jooby 4.3.0 #93
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Maven Central | |
| on: | |
| release: | |
| types: [created] | |
| jobs: | |
| release: | |
| name: Release on Sonatype OSS | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Setup gradle.properties | |
| env: | |
| GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }} | |
| shell: bash | |
| run: | | |
| mkdir -p ~/.gradle/ | |
| echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV | |
| echo "${GRADLE_PROPERTIES}" > ~/.gradle/gradle.properties | |
| - name: Build | |
| run: mvn clean install -DskipTests -q | |
| - name: Set up Maven Central | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| server-id: central | |
| server-username: CENTRAL_USERNAME | |
| server-password: CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - name: Publish to Maven Central | |
| run: mvn -pl '!tests' clean deploy -P bom,central,gradlePlugin | |
| env: | |
| CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | |
| CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
| update-release-notes: | |
| name: Update GitHub Release Notes | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate and Update Release Notes | |
| continue-on-error: true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| CURRENT_TAG=${{ github.ref_name }} | |
| VERSION_NUM=${CURRENT_TAG#v} | |
| # Calculate previous tag using version sorting | |
| git fetch --tags --force | |
| PREV_TAG=$(git tag --sort=-v:refname | grep -A 1 "^${CURRENT_TAG}$" | tail -n 1) | |
| # Fetch milestone ID for the link | |
| MILESTONE_ID=$(gh api repos/${{ github.repository }}/milestones -q ".[] | select(.title==\"$VERSION_NUM\") | .number") | |
| # 1. Fetch BREAKING changes (requires the 'break-change' label) | |
| gh issue list \ | |
| --repo ${{ github.repository }} \ | |
| --search "milestone:\"$VERSION_NUM\" label:break-change" \ | |
| --state all \ | |
| --limit 100 \ | |
| --json title,url \ | |
| --jq '.[] | "- [\(.title)](\(.url))"' > breaking_issues.md | |
| # 2. Fetch NEW features (requires the 'feature' label) | |
| gh issue list \ | |
| --repo ${{ github.repository }} \ | |
| --search "milestone:\"$VERSION_NUM\" label:feature -label:break-change" \ | |
| --state all \ | |
| --limit 100 \ | |
| --json title,url \ | |
| --jq '.[] | "- [\(.title)](\(.url))"' > new_issues.md | |
| # 3. Fetch OTHER changes (excludes 'feature', 'break-change', and 'dependencies') | |
| gh issue list \ | |
| --repo ${{ github.repository }} \ | |
| --search "milestone:\"$VERSION_NUM\" -label:feature -label:break-change -label:dependencies" \ | |
| --state all \ | |
| --limit 100 \ | |
| --json title,url \ | |
| --jq '.[] | "- [\(.title)](\(.url))"' > other_issues.md | |
| # 4. Initialize the changelog file | |
| > changelog.md | |
| # 5. Conditionally add "Breaking Changes" if breaking_issues.md has content (-s) | |
| if [ -s breaking_issues.md ]; then | |
| echo "## ⚠️ Breaking Changes" >> changelog.md | |
| echo "" >> changelog.md | |
| cat breaking_issues.md >> changelog.md | |
| echo "" >> changelog.md | |
| fi | |
| # 6. Conditionally add "What's New" if new_issues.md has content | |
| if [ -s new_issues.md ]; then | |
| echo "## 🚀 What's New" >> changelog.md | |
| echo "" >> changelog.md | |
| cat new_issues.md >> changelog.md | |
| echo "" >> changelog.md | |
| fi | |
| # 7. Conditionally add "Other Changes" if other_issues.md has content | |
| if [ -s other_issues.md ]; then | |
| echo "## 🛠️ Changes" >> changelog.md | |
| echo "" >> changelog.md | |
| cat other_issues.md >> changelog.md | |
| echo "" >> changelog.md | |
| fi | |
| # 8. Build the rest of the changelog (Links & Sponsors) | |
| cat << EOF >> changelog.md | |
| ### 🔗 Links & Resources | |
| - [$CURRENT_TAG](https://github.com/jooby-project/jooby/tree/$CURRENT_TAG) | |
| - [Closed Issues](https://github.com/jooby-project/jooby/milestone/$MILESTONE_ID?closed=1) | |
| - [Changelog](https://github.com/jooby-project/jooby/compare/$PREV_TAG...$CURRENT_TAG) | |
| - [Dependency Updates](https://github.com/jooby-project/jooby/pulls?q=is%3Apr+label%3Adependencies+is%3Aclosed+milestone%3A$VERSION_NUM) | |
| ## 💖 Support my work | |
| - [Sponsor Jooby](https://github.com/sponsors/jknack) | |
| ### 🏆 Sponsors | |
| - [@premium-minds](https://github.com/premium-minds) | |
| - [@agentgt](https://github.com/agentgt) | |
| - [@tipsy](https://github.com/tipsy) | |
| EOF | |
| # Overwrite the existing release notes | |
| gh release edit $CURRENT_TAG --notes-file changelog.md |