Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7f8d28e

Browse files
add a new release workflow
1 parent96f0173 commit7f8d28e

File tree

4 files changed

+251
-3
lines changed

4 files changed

+251
-3
lines changed

‎.github/workflows/docker-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
schedule:
1010
-cron:"27 0 * * *"
1111
push:
12-
branches:["main"]
12+
branches:["main", "next"]
1313
# Publish semver tags as releases.
1414
tags:["v*.*.*"]
1515
pull_request:
16-
branches:["main"]
16+
branches:["main", "next"]
1717

1818
env:
1919
# Use docker.io for Docker Hub if empty

‎.github/workflows/pr-base-check.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name:PR Base Branch Check
2+
3+
on:
4+
pull_request:
5+
types:[opened, edited, synchronize]
6+
branches:
7+
-main
8+
9+
permissions:
10+
pull-requests:write
11+
contents:read
12+
13+
jobs:
14+
check-base-branch:
15+
runs-on:ubuntu-latest
16+
if:github.event.pull_request.base.ref == 'main'
17+
18+
steps:
19+
-name:Comment on PR
20+
uses:actions/github-script@v7
21+
with:
22+
script:|
23+
const message = `👋 Hi there!
24+
25+
It looks like this PR is targeting the \`main\` branch. To help maintain our development workflow, please change the base reference to \`next\` instead.
26+
27+
__If this is a bug fix that requires a patch release __ (e.g., a critical bug that needs to be fixed before the next release)__, please leave the base branch as \`main\`.__
28+
29+
You can change this by:
30+
1. Clicking the "Edit" button next to the PR title
31+
2. Changing the base branch from \`main\` to \`next\`
32+
3. Clicking "Update pull request"
33+
34+
Thanks for your contribution! 🚀`;
35+
36+
// Check if we've already commented
37+
const comments = await github.rest.issues.listComments({
38+
owner: context.repo.owner,
39+
repo: context.repo.repo,
40+
issue_number: context.issue.number,
41+
});
42+
43+
const botComment = comments.data.find(comment =>
44+
comment.user.type === 'Bot' &&
45+
comment.body.includes('please change the base reference to')
46+
);
47+
48+
if (!botComment) {
49+
await github.rest.issues.createComment({
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
issue_number: context.issue.number,
53+
body: message
54+
});
55+
}

‎.github/workflows/release.yml

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
name:Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description:'Release tag (e.g., v0.0.0)'
8+
required:true
9+
default:'v0.0.0'
10+
type:string
11+
confirm:
12+
description:'Type "CONFIRM" to proceed with the release'
13+
required:true
14+
type:string
15+
16+
permissions:
17+
contents:write
18+
pull-requests:write
19+
20+
jobs:
21+
validate:
22+
runs-on:ubuntu-latest
23+
steps:
24+
-name:Validate confirmation
25+
if:${{ github.event.inputs.confirm != 'CONFIRM' }}
26+
run:|
27+
echo "::error::You must type 'CONFIRM' to proceed with the release"
28+
exit 1
29+
30+
-name:Validate tag format
31+
run:|
32+
TAG="${{ github.event.inputs.tag }}"
33+
if [[ ! $TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$ ]]; then
34+
echo "::error::Tag must be in format vX.Y.Z or vX.Y.Z-suffix (e.g., v1.0.0 or v1.0.0-rc1)"
35+
exit 1
36+
fi
37+
38+
release:
39+
needs:validate
40+
runs-on:ubuntu-latest
41+
outputs:
42+
pr-number:${{ steps.create-pr.outputs.pr-number }}
43+
pr-url:${{ steps.create-pr.outputs.pr-url }}
44+
45+
steps:
46+
-name:Checkout repository
47+
uses:actions/checkout@v4
48+
with:
49+
fetch-depth:0
50+
token:${{ secrets.GITHUB_TOKEN }}
51+
52+
-name:Configure Git
53+
run:|
54+
git config user.name "github-actions[bot]"
55+
git config user.email "github-actions[bot]@users.noreply.github.com"
56+
57+
-name:Switch to next branch
58+
run:|
59+
git checkout next
60+
git pull origin next
61+
62+
-name:Rebase next with main
63+
id:rebase
64+
run:|
65+
echo "Attempting to rebase next with main..."
66+
if git rebase origin/main; then
67+
echo "✅ Rebase successful"
68+
echo "rebase-success=true" >> $GITHUB_OUTPUT
69+
else
70+
echo "::error::❌ Rebase failed due to conflicts. Please resolve conflicts manually and try again."
71+
echo "Conflicts detected in the following files:"
72+
git status --porcelain | grep "^UU\|^AA\|^DD" ||true
73+
echo "rebase-success=false" >> $GITHUB_OUTPUT
74+
exit 1
75+
fi
76+
77+
-name:Check if tag already exists
78+
run:|
79+
TAG="${{ github.event.inputs.tag }}"
80+
if git tag -l | grep -q "^${TAG}$"; then
81+
echo "::error::Tag ${TAG} already exists"
82+
exit 1
83+
fi
84+
if git ls-remote --tags origin | grep -q "refs/tags/${TAG}$"; then
85+
echo "::error::Tag ${TAG} already exists on remote"
86+
exit 1
87+
fi
88+
89+
-name:Tag the release
90+
run:|
91+
TAG="${{ github.event.inputs.tag }}"
92+
git tag -a "${TAG}" -m "Release ${TAG}"
93+
echo "✅ Created tag ${TAG}"
94+
95+
-name:Create Pull Request
96+
id:create-pr
97+
run:|
98+
TAG="${{ github.event.inputs.tag }}"
99+
100+
# Create PR from next to main
101+
PR_RESPONSE=$(gh pr create \
102+
--base main \
103+
--head next \
104+
--title "Release ${TAG}" \
105+
--body "This PR contains the changes for release ${TAG}.
106+
107+
**Release checklist:**
108+
- [ ] Review the changes
109+
- [ ] Ensure all tests pass
110+
- [ ] Verify the release notes in the draft release
111+
- [ ] Merge this PR after the release is published
112+
113+
Created by the automated release workflow." \
114+
--json number,url)
115+
116+
PR_NUMBER=$(echo "$PR_RESPONSE" | jq -r '.number')
117+
PR_URL=$(echo "$PR_RESPONSE" | jq -r '.url')
118+
119+
echo "pr-number=${PR_NUMBER}" >> $GITHUB_OUTPUT
120+
echo "pr-url=${PR_URL}" >> $GITHUB_OUTPUT
121+
echo "✅ Created PR #${PR_NUMBER}: ${PR_URL}"
122+
env:
123+
GH_TOKEN:${{ secrets.GITHUB_TOKEN }}
124+
125+
-name:Push tag
126+
run:|
127+
TAG="${{ github.event.inputs.tag }}"
128+
git push origin "${TAG}"
129+
echo "✅ Pushed tag ${TAG}"
130+
131+
-name:Wait for release to be created
132+
run:|
133+
TAG="${{ github.event.inputs.tag }}"
134+
echo "Waiting for GitHub to create the draft release..."
135+
136+
# Wait up to 2 minutes for the release to appear
137+
for i in {1..24}; do
138+
if gh release view "${TAG}" >/dev/null 2>&1; then
139+
echo "✅ Draft release created"
140+
break
141+
fi
142+
echo "Waiting for release to be created... (${i}/24)"
143+
sleep 5
144+
done
145+
env:
146+
GH_TOKEN:${{ secrets.GITHUB_TOKEN }}
147+
148+
summary:
149+
needs:[validate, release]
150+
runs-on:ubuntu-latest
151+
if:always() && needs.release.result == 'success'
152+
153+
steps:
154+
-name:Release Summary
155+
run:|
156+
TAG="${{ github.event.inputs.tag }}"
157+
PR_URL="${{ needs.release.outputs.pr-url }}"
158+
159+
echo "## 🎉 Release $TAG has been initiated!"
160+
echo ""
161+
echo "### Next steps:"
162+
echo "1. 📋 Check https://github.com/${{ github.repository }}/releases for the draft release to show up"
163+
echo "2. ✏️ Edit the new release, delete the existing notes and click the auto-generate button GitHub provides"
164+
echo "3. ✨ Add a section at the top calling out the main features"
165+
echo "4. 🚀 Publish the release"
166+
echo "5. 🔀 Merge the pull request into main: ${PR_URL}"
167+
echo "6. Post message in #gh-mcp-releases channel in Slack and then share to the other mcp channels"
168+
echo ""
169+
echo "### Resources:"
170+
echo "- 📦 Draft Release: https://github.com/${{ github.repository }}/releases/tag/$TAG"
171+
echo "- 🔄 Pull Request: ${PR_URL}"
172+
echo ""
173+
echo "The release process is now ready for your review and completion!"
174+
175+
# Also output as job summary
176+
cat << EOF >> $GITHUB_STEP_SUMMARY
177+
## 🎉 Release $TAG has been initiated!
178+
179+
### Next steps:
180+
1. 📋 Check [releases page](https://github.com/${{ github.repository }}/releases) for the draft release to show up
181+
2. ✏️ Edit the new release, delete the existing notes and click the auto-generate button GitHub provides
182+
3. ✨ Add a section at the top calling out the main features
183+
4. 🚀 Publish the release
184+
5. 🔀 Merge the pull request into main: [PR #${{ needs.release.outputs.pr-number }}](${PR_URL})
185+
186+
### Resources:
187+
- 📦 [Draft Release](https://github.com/${{ github.repository }}/releases/tag/$TAG)
188+
- 🔄 [Pull Request](${PR_URL})
189+
190+
The release process is now ready for your review and completion!
191+
EOF

‎CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ These are one time installations required to be able to test your changes locall
1919

2020
##Submitting a pull request
2121

22+
>**Important**: Please open your pull request against the`next` branch, not`main`. The`next` branch is where we integrate new features and changes before they are merged to`main`.
23+
2224
1.[Fork][fork] and clone the repository
2325
1. Make sure the tests pass on your machine:`go test -v ./...`
2426
1. Make sure linter passes on your machine:`golangci-lint run`
2527
1. Create a new branch:`git checkout -b my-branch-name`
2628
1. Make your change, add tests, and make sure the tests and linter still pass
27-
1. Push to your fork and[submit a pull request][pr]
29+
1. Push to your fork and[submit a pull request][pr] targeting the`next` branch
2830
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.
2931

3032
Here are a few things you can do that will increase the likelihood of your pull request being accepted:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp