Skip to content

Commit 03436ff

Browse files
committed
Consolidate milestone badge publishing into Pages build
1 parent c18747a commit 03436ff

3 files changed

Lines changed: 33 additions & 56 deletions

File tree

.github/workflows/build.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Triggers:
77
# - pull_request: when a PR targets main
88
# - push: when code is pushed to main
9+
# - milestone: when milestone metadata changes
910
#
1011
# Notes:
1112
# Builds against Java 17, 21, and 25.
@@ -15,6 +16,8 @@ run-name: Build - ${{ github.event_name }}
1516

1617
on:
1718
workflow_dispatch:
19+
milestone:
20+
types: [created, edited, closed, deleted]
1821
pull_request:
1922
branches:
2023
- main
@@ -38,6 +41,7 @@ on:
3841

3942
permissions:
4043
contents: read
44+
issues: read
4145
pages: write
4246
id-token: write
4347

@@ -54,6 +58,8 @@ jobs:
5458
steps:
5559
- name: Checkout repository
5660
uses: actions/checkout@v7
61+
with:
62+
ref: ${{ github.event_name == 'milestone' && github.event.repository.default_branch || github.ref }}
5763

5864
- name: Setup Java ${{ matrix.java }}
5965
uses: actions/setup-java@v5
@@ -76,16 +82,38 @@ jobs:
7682
if: ${{ matrix.java == 17 }}
7783
run: mvn -B -pl sdk -am javadoc:javadoc
7884

85+
- name: Generate milestone badge
86+
if: ${{ matrix.java == 17 }}
87+
env:
88+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
run: |
90+
set -euo pipefail
91+
92+
TITLE=$(gh api repos/${{ github.repository }}/milestones \
93+
--jq '[.[] | select(.state == "open" and .due_on != null)] | sort_by(.due_on) | .[0].title // empty')
94+
95+
if [ -z "$TITLE" ]; then
96+
URL="https://img.shields.io/badge/Next%20Milestone-No%20milestone-lightgrey"
97+
else
98+
ENCODED=$(echo -n "$TITLE" | jq -sRr @uri | sed 's/-/--/g')
99+
URL="https://img.shields.io/badge/Next%20Milestone-${ENCODED}-blue"
100+
fi
101+
102+
mkdir -p milestone
103+
curl -sfL "$URL" -o milestone/badge.svg
104+
echo "Badge generated for: ${TITLE:-No milestone}"
105+
79106
- name: Configure GitHub Pages
80107
if: ${{ matrix.java == 17 }}
81108
uses: actions/configure-pages@v5
82109

83110
- name: Prepare GitHub Pages artifact
84111
if: ${{ matrix.java == 17 }}
85112
run: |
86-
mkdir -p github-pages/coverage github-pages/javadoc
113+
mkdir -p github-pages/coverage github-pages/javadoc github-pages/milestone
87114
cp -R coverage-report/target/site/jacoco-aggregate/. github-pages/coverage
88115
cp -R sdk/target/reports/apidocs/. github-pages/javadoc
116+
cp -R milestone/. github-pages/milestone
89117
touch github-pages/.nojekyll
90118
91119
- name: Upload GitHub Pages artifact
@@ -95,7 +123,7 @@ jobs:
95123
path: github-pages
96124

97125
deploy-pages:
98-
if: ${{ github.ref == 'refs/heads/main' }}
126+
if: ${{ github.event_name == 'milestone' || github.ref == 'refs/heads/main' }}
99127
needs: build
100128
runs-on: ubuntu-latest
101129
environment:

.github/workflows/update-milestone-badge.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
[![Build](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/build.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/build.yml)
66
[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://aws.github.io/aws-durable-execution-sdk-java/javadoc/)
77
[![Maven](https://badges.mvnrepository.com/badge/software.amazon.lambda.durable/aws-durable-execution-sdk-java/badge.svg?label=Maven)](https://mvnrepository.com/artifact/software.amazon.lambda.durable/aws-durable-execution-sdk-java)
8-
[![Coverage](https://raw.githubusercontent.com/aws/aws-durable-execution-sdk-java/refs/heads/docs/coverage/jacoco.svg)](https://aws.github.io/aws-durable-execution-sdk-java/coverage/)
8+
[![Coverage](https://aws.github.io/aws-durable-execution-sdk-java/coverage/jacoco.svg)](https://aws.github.io/aws-durable-execution-sdk-java/coverage/)
99
[![E2E Tests](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/e2e-tests.yml)
1010
[![CodeQL](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/github-code-scanning/codeql)
1111
[![Spotless](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/check-spotless.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/check-spotless.yml)
12-
[![Roadmap](https://raw.githubusercontent.com/aws/aws-durable-execution-sdk-java/refs/heads/docs/milestone/badge.svg)](https://github.com/orgs/aws/projects/346/views/6)
12+
[![Roadmap](https://aws.github.io/aws-durable-execution-sdk-java/milestone/badge.svg)](https://github.com/orgs/aws/projects/346/views/6)
1313

1414
Build resilient, long-running AWS Lambda functions that automatically checkpoint progress and resume after failures. Durable functions can run for up to one year while you pay only for active compute time.
1515

@@ -110,6 +110,7 @@ See [Deploy Lambda durable functions with Infrastructure as Code](https://docs.a
110110
- [<u>Configuration</u>](docs/advanced/configuration.md) - Customize SDK behaviour
111111
- [<u>Error Handling</u>](docs/advanced/error-handling.md) - SDK exceptions for handling failures
112112
- [<u>Logging</u>](docs/advanced/logging.md) - How to use DurableLogger
113+
- [<u>Migrating from 1.x to 2.x</u>](docs/migration-1.x-to-2.x.md) - Upgrade guide for breaking changes since `v1.2.1`
113114
- [<u>Testing</u>](docs/advanced/testing.md) - Utilities for local development and cloud-based integration testing
114115

115116
## Related SDKs

0 commit comments

Comments
 (0)