Skip to content

Commit

Permalink
feat: add support for BETA releases
Browse files Browse the repository at this point in the history
Code diff represents changes made to two YAML files: .github/settings.yml and .github/workflows/testPublish.yml, as well as a package.json file.

In the .github/settings.yml file, the following changes were made:

1. The v4.0-rc branch was modified to require code owner reviews before merging.
2. The master branch was modified to require at least one approving review on a pull request before merging.
3. The beta branch was added with the same branch protection settings as the master branch.
4. In the .github/workflows/testPublish.yml file, the following changes were made:

The release job was modified to trigger on push events to the master branch or the beta branch.
In the package.json file, the following changes were made:

1. The release configuration was modified to include the beta branch as a release branch with prerelease set to true.
2. These changes are related to branch protection settings and release configurations for a GitHub repository.

The updates in the ./template directory mirror the changes made in the root directory. Changes are intended to
update the default configuration for new projects based on this template.

In the ./template/.github/settings.yml file, the following changes were made:

1. The main branch was modified to use the default_protection settings.
2. The beta branch was added with the same branch protection settings as the main branch.
3. In the ./template/.github/workflows/testPublish.yml file, the following changes were made:

The release job was modified to trigger on push events to the main branch or the beta branch.
In the ./template/package.json file, the following changes were made:

1. The release configuration was modified to include the beta branch as a release branch with prerelease set to true.
2. These changes are related to branch protection settings and release configurations for a GitHub repository.

They ensure that new projects created from this template will have these settings by default.

Changes to be committed:
modified:   .github/settings.yml
modified:   .github/workflows/testPublish.yml
modified:   package.json
modified:   template/.github/settings.yml
modified:   template/.github/workflows/testPublish.yml
modified:   template/package.json
  • Loading branch information
blackfalcon committed Jun 17, 2024
1 parent 3e7abf0 commit 295da1b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
36 changes: 8 additions & 28 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repository:
allow_rebase_merge: true

branches:
- name: v4.0-rc
- &default_protection
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
Expand All @@ -46,34 +46,8 @@ branches:
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: false
require_code_owner_reviews: true
# Required. Require status checks to pass before merging. Set to null to disable
dismissal_restrictions:
users: ["blackfalcon"]
# Required. Require status checks to pass before merging. Set to null to disable
required_status_checks:
# Required. Require branches to be up to date before merging.
strict: true
# Required. The list of status checks to require in order to merge into this branch
contexts: ["test (18.x)", "test (20.x)", "license/cla"]
# Required. Enforce all configured restrictions for administrators. Set to true to enforce required status checks for repository administrators. Set to null to disable.
enforce_admins: false
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
restrictions: null
# Prevent merge commits from being pushed to matching branches
required_linear_history: true
- name: master
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
required_pull_request_reviews:
# The number of approvals required. (1-6)
required_approving_review_count: 1
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: false
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
dismissal_restrictions:
users: ["blackfalcon"]
Expand All @@ -90,6 +64,12 @@ branches:
# Prevent merge commits from being pushed to matching branches
required_linear_history: true

- name: master
<<: *default_protection

- name: beta
<<: *default_protection

# Labels: define labels for Issues and Pull Requests
labels:
- name: wc-generator
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

release:
# Only release on push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/master' || 'refs/heads/beta'
runs-on: ubuntu-latest
needs: test
steps:
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@
"generator"
],
"release": {
"branch": "master",
"branches": [
{
"name": "main"
},
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down
8 changes: 7 additions & 1 deletion template/.github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ teams:
permission: push

branches:
- name: main
- &default_protection
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
Expand Down Expand Up @@ -81,6 +81,12 @@ branches:
# Prevent merge commits from being pushed to matching branches
required_linear_history: true

- name: main
<<: *default_protection

- name: beta
<<: *default_protection

# Labels: define labels for Issues and Pull Requests
labels:
- name: [namespace]-[name]
Expand Down
2 changes: 1 addition & 1 deletion template/.github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

release:
# Only release on push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || 'refs/heads/beta'
runs-on: ubuntu-latest
needs: test
steps:
Expand Down
8 changes: 7 additions & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@
},
"release": {
"branches": [
"main"
{
"name": "main"
},
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down

0 comments on commit 295da1b

Please sign in to comment.