Skip to content

Commit

Permalink
build: update to support BETA releases
Browse files Browse the repository at this point in the history
See discussion: https://github.com/orgs/AlaskaAirlines/discussions/556

1. Branch protection settings are standardized and reused across main and beta branches.
2. A new beta branch is added with the same protection rules as main.
3. Workflows are updated to trigger releases on pushes to both main and beta.
4. The release configuration in package.json includes beta as a prerelease branch,
   allowing for pre-release versions to be handled separately from the main release.

Changes to be committed:
modified:   .github/settings.yml
modified:   .github/workflows/testPublish.yml
modified:   package.json
  • Loading branch information
blackfalcon committed Jun 18, 2024
1 parent 00b22a8 commit 6ac1e44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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 All @@ -70,11 +70,19 @@ branches:
# 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)", "license/cla"]
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: main
<<: *default_protection

- name: beta
<<: *default_protection

# Labels: define labels for Issues and Pull Requests
labels:
Expand Down
2 changes: 1 addition & 1 deletion .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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@
},
"release": {
"branches": [
"main"
{
"name": "main"
},
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down

0 comments on commit 6ac1e44

Please sign in to comment.