Repository navigation
62 lines (59 loc) · 3.1 KB
/
Copy pathagent-patch-release.yml
File metadata and controls
62 lines (59 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Prepares a patch release of Playwright Python from a release branch: the next v1.xx.y after the
# last tag of the branch. Starts the Playwright bot with the task below. The bot starts from the
# branch and writes the release notes with the playwright-patch-release skill of main: the list of
# the fixes in microsoft/playwright between the driver of the previous release of the branch and
# the driver of its tip. The bot then saves the notes as a draft release, in place of the draft of
# an earlier run. A maintainer reviews the draft and publishes it. Start it from the Actions tab.
name: "Agent: patch release"
on:
workflow_dispatch:
inputs:
branch:
description: "Release branch to release from: release-1.xx"
required: true
permissions: {}
jobs:
start:
name: Hand the task to the bot
if: github.repository == 'microsoft/playwright-python'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
id: app-token
with:
client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }}
private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}
owner: microsoft
repositories: devops.playwright.dev
permission-actions: write
- name: Start the bot
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
BRANCH: ${{ inputs.branch }}
# The skill is new on main, and a release branch can have an old copy or none. So the bot
# reads it from main. YAML folds these lines into one line.
TASK: >-
Prepare the next patch release of the ${{ inputs.branch }} branch of Playwright Python,
as the playwright-patch-release skill says.
Your checkout is the ${{ inputs.branch }} branch, not main.
Read the skill from main:
git show origin/main:.claude/skills/playwright-patch-release/SKILL.md.
The remote of the skill is origin.
Pick the next version, and write the release notes: the list of the fixes in the commits
of microsoft/playwright between the DRIVER_VERSION of the previous release of the branch
and the DRIVER_VERSION of the tip of ${{ inputs.branch }}.
Open no pull request.
End with one release call: tag is the next version, target is ${{ inputs.branch }}, and
the text is the release notes and nothing else.
When there is nothing to release, make no call, and say so in the summary.
run: |
# A patch release comes only from a release branch. The first release of a branch, v1.xx.0,
# has the full release notes: the playwright-release skill prepares it.
if [[ ! "$BRANCH" =~ ^release-[0-9]+\.[0-9]+$ ]]; then
echo "::error::branch must be release-1.xx, got '$BRANCH'"
exit 1
fi
gh workflow run task.yml --repo microsoft/devops.playwright.dev --ref main \
-f repo="$GITHUB_REPOSITORY" -f branch="$BRANCH" -f task="$TASK"
echo "Started the patch release of $BRANCH. The bot saves the release notes as a draft release." >> "$GITHUB_STEP_SUMMARY"