-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ci: Setup gitflow process #6890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+161
−31
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Gitflow - Sync master into develop | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
# When the version is updated on master (but nothing else) | ||
- 'lerna.json' | ||
- '!**/*.js' | ||
- '!**/*.ts' | ||
workflow_dispatch: | ||
|
||
env: | ||
DEV_BRANCH: develop | ||
|
||
jobs: | ||
main: | ||
name: Create PR master->develop | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v3 | ||
|
||
# https://github.com/marketplace/actions/github-pull-request-action | ||
- name: Create Pull Request | ||
id: open-pr | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
destination_branch: ${{ env.DEV_BRANCH }} | ||
pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.DEV_BRANCH }}' | ||
pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.DEV_BRANCH }}' | ||
|
||
# https://github.com/marketplace/actions/enable-pull-request-automerge | ||
- name: Enable automerge for PR | ||
if: steps.open-pr.outputs.pr_number != '' | ||
uses: peter-evans/enable-pull-request-automerge@v2 | ||
with: | ||
pull-request-number: ${{ steps.open-pr.outputs.pr_number }} | ||
merge-method: merge | ||
|
||
# https://github.com/marketplace/actions/auto-approve | ||
- name: Auto approve PR | ||
uses: hmarr/auto-approve-action@v3 | ||
with: | ||
pull-request-number: ${{ steps.open-pr.outputs.pr_number }} | ||
review-message: 'Auto approved automated PR' | ||
# TODO: Use the token of some user here?? | ||
# github-token: ${{ secrets.SOME_USERS_PAT }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Gitflow - Sync develop into master | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
paths: | ||
# We want to trigger this when ONLY the changlog is changed on develop, but nothing else | ||
- 'CHANGELOG.md' | ||
- '!packages' | ||
- '!**/*.js' | ||
- '!**/*.json' | ||
- '!**/*.ts' | ||
workflow_dispatch: | ||
|
||
env: | ||
MAIN_BRANCH: master | ||
|
||
jobs: | ||
main: | ||
name: Create PR develop->master | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: git checkout | ||
uses: actions/checkout@v3 | ||
|
||
# https://github.com/marketplace/actions/github-pull-request-action | ||
- name: Create Pull Request | ||
id: open-pr | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
destination_branch: ${{ env.MAIN_BRANCH }} | ||
pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.MAIN_BRANCH }}' | ||
pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.MAIN_BRANCH }}' | ||
|
||
# https://github.com/marketplace/actions/enable-pull-request-automerge | ||
- name: Enable automerge for PR | ||
if: steps.open-pr.outputs.pr_number != '' | ||
uses: peter-evans/enable-pull-request-automerge@v2 | ||
with: | ||
pull-request-number: ${{ steps.open-pr.outputs.pr_number }} | ||
merge-method: merge | ||
|
||
# https://github.com/marketplace/actions/auto-approve | ||
- name: Auto approve PR | ||
uses: hmarr/auto-approve-action@v3 | ||
with: | ||
pull-request-number: ${{ steps.open-pr.outputs.pr_number }} | ||
review-message: 'Auto approved automated PR' | ||
# TODO: Use the token of some user here?? | ||
# github-token: ${{ secrets.SOME_USERS_PAT }} |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Gitflow | ||
|
||
We use [Gitflow](https://docs.github.com/en/get-started/quickstart/github-flow) as a branching model. | ||
|
||
## Summary | ||
|
||
* Ongoing work happens on the `develop` branch | ||
* Any PRs (features, ...) are implemented as PRs against `develop` | ||
* When we are ready to release, we merge develop into master, create a release there, then merge master back into develop | ||
* Whatever is currently on `master` can be considered the last released state of the SDK | ||
* Never merge directly into `master` (unless we want e.g. an emergency bugfix release) | ||
|
||
 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
# Publishing a Release | ||
|
||
_These steps are only relevant to Sentry employees when preparing and publishing a new SDK release._ | ||
|
||
**If you want to release a new SDK for the first time, be sure to follow the [New SDK Release Checklist](./new-sdk-release-checklist.md)** | ||
|
||
1. Determine what version will be released (we use [semver](https://semver.org)). | ||
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. (See details below.) | ||
a. Merging the Changelog PR will automatically trigger a sync from `develop` -> `master` | ||
3. Run the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) workflow. | ||
a. Wait for this until the sync to `master` is completed. | ||
4. A new issue should appear in https://github.com/getsentry/publish/issues. | ||
5. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release. | ||
a. Once the release is completed, a sync from `master` ->` develop` will be automatically triggered | ||
|
||
## Updating the Changelog | ||
|
||
1. Create a new branch. | ||
2. Run `git log --format="- %s"` and copy everything since the last release. | ||
3. Create a new section in the changelog, deciding based on the changes whether it should be a minor bump or a patch release. | ||
4. Paste in the logs you copied earlier. | ||
5. Delete any which aren't user-facing changes. | ||
6. Alphabetize the rest. | ||
7. If any of the PRs are from external contributors, include underneath the commits `Work in this release contributed by <list of external contributors' GitHub usernames>. Thank you for your contributions!`. If there's only one external PR, don't forget to remove the final `s`. If there are three or more, use an Oxford comma. (It's in the Sentry styleguide!) | ||
8. Commit, push, and open a PR with the title `meta: Update changelog for <fill in relevant version here>` against `develop` branch. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.