Skip to content

Commit

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

This diff modifies the `.github/settings.yml`, `.github/workflows/testPublish.yml`,
and `package.json` files.

In `.github/settings.yml`, it adds a `required_linear_history` setting to
the `main` and `beta` branches to prevent merge commits from being
pushed to those branches.

In `.github/workflows/testPublish.yml`, it updates the `branches` section to
include both `main` and `beta` branches for the `push` and `pull_request` events.

In `package.json`, it adds a `beta` branch with the `prerelease` flag set to
`true` in the `release.branches` section.

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 4d670a1 commit c2fc1c4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
12 changes: 10 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repository:
allow_rebase_merge: true

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 @@ -60,11 +60,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
ccontexts: ["test (18.x)", "test (20.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
6 changes: 3 additions & 3 deletions .github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Test and publish
# events but only for the main branch
on:
push:
branches: [ main ]
branches: [ main, beta ]
pull_request:
branches: [ main ]
branches: [ main, beta ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -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 @@ -101,7 +101,13 @@
},
"release": {
"branches": [
"main"
{
"name": "main"
},
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
Expand Down

0 comments on commit c2fc1c4

Please sign in to comment.