Skip to content
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
aad5ca7
on include PR in notes
khang-vu-ttd Feb 27, 2026
b7a299d
see if this fixes the PR getting issue
khang-vu-ttd Feb 27, 2026
7701113
see what the message is
khang-vu-ttd Feb 27, 2026
e8171e8
add tail
khang-vu-ttd Feb 27, 2026
5a2fcce
dont reset subject
khang-vu-ttd Feb 27, 2026
efa970e
trim subject
khang-vu-ttd Feb 27, 2026
90e500e
dont use tail
khang-vu-ttd Feb 27, 2026
583ffee
remove starting empty
khang-vu-ttd Feb 27, 2026
804ff9a
strangeling pipe char
khang-vu-ttd Feb 27, 2026
428475f
testing with no bump in commit
khang-vu-ttd Feb 27, 2026
8a4a585
testing
khang-vu-ttd Feb 27, 2026
1f80a31
dont bump of minor for testing
khang-vu-ttd Feb 27, 2026
13d3d10
dont bump of minor for testing
khang-vu-ttd Feb 27, 2026
90b7ad1
fix wording
khang-vu-ttd Feb 27, 2026
41fae40
final
khang-vu-ttd Feb 27, 2026
c5aa949
final workflow
khang-vu-ttd Feb 27, 2026
670a16c
rename workflow to just release
khang-vu-ttd Feb 27, 2026
02d4fed
use release bot
khang-vu-ttd Mar 2, 2026
71c5be5
use release bot for commiting
khang-vu-ttd May 21, 2026
f7ba1bb
fix error, and disable bumping up version while testing
khang-vu-ttd May 22, 2026
75cc5c4
read the version as is for testing
khang-vu-ttd May 22, 2026
27e93ec
rename the testing job id
khang-vu-ttd May 22, 2026
c5e0093
testing
khang-vu-ttd May 22, 2026
35af1ca
use title to construct commit list details
khang-vu-ttd May 22, 2026
48b55fa
testing
khang-vu-ttd May 22, 2026
c20592a
clean up commit details
khang-vu-ttd May 22, 2026
c7e2427
cut to much of the commit message
khang-vu-ttd May 22, 2026
2d7e65d
final (for now)
khang-vu-ttd May 22, 2026
faab539
Merge branch 'master' into kvu-OPATH-5586-release-workflow-fixed
khang-vu-ttd May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 54 additions & 30 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release Drafter
name: Release
on:
workflow_dispatch:
schedule:
- cron: '0 0 1-7 * 1' # First Monday of every month at midnight UTC
- cron: '0 0 1-7 * 3' # First Wednesday of every month at midnight UTC

permissions:
contents: write
Expand All @@ -12,11 +12,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate GitHub App token
id: app_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v6
with:
ref: master
fetch-depth: 0 # full history needed for git log/tags
token: ${{ steps.app_token.outputs.token }}

- name: Get latest tag
id: latest_tag
Expand Down Expand Up @@ -49,25 +57,46 @@ jobs:
OA_VERSION=$(jq -r '.oaVersion' package.json)
PREBID_VERSION=$(jq -r '.version' package.json)

# Increment minor version (major.minor.patch → major.(minor+1).patch)
MAJOR=$(echo "$OA_VERSION" | cut -d. -f1)
MINOR=$(echo "$OA_VERSION" | cut -d. -f2)
PATCH=$(echo "$OA_VERSION" | cut -d. -f3)
NEW_MINOR=$((MINOR + 1))
NEW_OA_VERSION="${MAJOR}.${NEW_MINOR}.${PATCH}"

# Write new version back to package.json
jq --arg v "$NEW_OA_VERSION" '.oaVersion = $v' package.json > package.tmp.json
mv package.tmp.json package.json
# Check if oaVersion differs between master and the last tagged commit
TAG="${{ steps.latest_tag.outputs.tag }}"
if [ -n "$TAG" ]; then
TAGGED_OA_VERSION=$(git show "$TAG":package.json | jq -r '.oaVersion')
echo "oaVersion on master: $OA_VERSION"
echo "oaVersion on last tag ($TAG): $TAGGED_OA_VERSION"
fi

if [ -n "$TAG" ] && [ "$OA_VERSION" != "$TAGGED_OA_VERSION" ]; then
echo "oaVersion has been manually changed since last tag — skipping minor increment."
NEW_OA_VERSION="$OA_VERSION"

echo "version_bumped=false" >> $GITHUB_OUTPUT
else
echo "oaVersion unchanged since last tag — incrementing minor."
NEW_MINOR=$((MINOR + 1))
NEW_OA_VERSION="${MAJOR}.${NEW_MINOR}.${PATCH}"

# Write new version back to package.json
jq --arg v "$NEW_OA_VERSION" '.oaVersion = $v' package.json > package.tmp.json
mv package.tmp.json package.json

echo "version_bumped=true" >> $GITHUB_OUTPUT
fi

echo "oa_version=$NEW_OA_VERSION" >> $GITHUB_OUTPUT
echo "prebid_version=$PREBID_VERSION" >> $GITHUB_OUTPUT

- name: Commit incremented OA version
if: steps.changes.outputs.has_changes == 'true'
if: steps.changes.outputs.has_changes == 'true' && steps.versions.outputs.version_bumped == 'true'
env:
GH_TOKEN: ${{ steps.app_token.outputs.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git"
git add package.json
git commit -m "chore: bump OpenAds version to ${{ steps.versions.outputs.oa_version }}"
git push origin HEAD:master
Expand All @@ -78,7 +107,7 @@ jobs:
if: steps.changes.outputs.has_changes == 'true'
id: commits
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app_token.outputs.token }}
run: |
TAG="${{ steps.latest_tag.outputs.tag }}"
REPO="${{ github.repository }}"
Expand All @@ -89,48 +118,43 @@ jobs:
RANGE="$TAG..HEAD"
fi

# Collect commits: "<sha> <subject>"
LINES=""
while IFS= read -r line; do
SHA=$(echo "$line" | awk '{print $1}')
SUBJECT=$(echo "$line" | cut -d' ' -f2-)

# Try to extract a PR number from the commit subject, e.g. "(#123)"
PR_NUM=$(echo "$SUBJECT" | grep -oP '#\K[0-9]+' | head -1)
while IFS= read -r -d $'\x00' commit; do
TITLE=$(echo "$commit" | awk -F'|SEP|' '{print $2}' | xargs -0| sed '/^$/d' | sed 's/^[[:space:]]*//')

# Try to extract a PR number from the title, e.g. "#123"
PR_NUM=$(echo "$TITLE" | grep -oP '#\K[0-9]+' | head -1)

if [ -n "$PR_NUM" ]; then
# Remove the PR reference like "(#123)" from the title
BODY=$(echo "$TITLE" | sed "s/ *(#${PR_NUM}) *|//" | cut -c2-)
PR_URL="https://github.com/$REPO/pull/$PR_NUM"
ENTRY="- [#${PR_NUM}](${PR_URL}) ${SUBJECT}"
else
SHORT_SHA="${SHA:0:7}"
COMMIT_URL="https://github.com/$REPO/commit/$SHA"
ENTRY="- [${SHORT_SHA}](${COMMIT_URL}) ${SUBJECT}"
ENTRY="- [#${PR_NUM}](${PR_URL}) ${BODY}"
LINES="${LINES}${ENTRY}"$'\n'
fi

LINES="${LINES}${ENTRY}"$'\n'
done < <(git log "$RANGE" --pretty=format:"%H %s")
done < <(git log "$RANGE" --pretty=format:"%H|SEP|%s|SEP|%b%x00")

# Write to a file to safely pass multiline content
echo "$LINES" > /tmp/commit_list.txt
cat /tmp/commit_list.txt

- name: Create GitHub Release
if: steps.changes.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app_token.outputs.token }}
run: |
OA_VERSION="${{ steps.versions.outputs.oa_version }}"
PREBID_VERSION="${{ steps.versions.outputs.prebid_version }}"
COMMIT_LIST=$(cat /tmp/commit_list.txt)

{
echo "Including Prebid features up to v${PREBID_VERSION}: https://github.com/prebid/Prebid.js/releases/tag/${PREBID_VERSION}"
echo "Including Prebid features up to [v${PREBID_VERSION}](https://github.com/prebid/Prebid.js/releases/tag/${PREBID_VERSION})"
echo ""
echo "OpenAdsJs Changes"
echo "${COMMIT_LIST}"
} > /tmp/release_notes.md

gh release create "v${OA_VERSION}" \
--title "OpenAds ${OA_VERSION}" \
--notes-file /tmp/release_notes.md \
--target "oajs_v${{ steps.versions.outputs.oa_version }}"
gh release create "oajs_v${OA_VERSION}" \
--title "OpenAdsJs v${OA_VERSION}" \
--notes-file /tmp/release_notes.md
Loading