From 51ab82df3fe3221f60a554124d99b935900dd732 Mon Sep 17 00:00:00 2001 From: Dale Sande Date: Tue, 18 Jun 2024 18:59:35 -0700 Subject: [PATCH] build: update to support BETA releases See discussion: https://github.com/orgs/AlaskaAirlines/discussions/556 Here's a brief description of the changes: 1. `.github/settings.yml`: This file is used to configure GitHub repository settings. The changes made here include: - The branch protection rules that were previously applied to the `main` branch are now defined under a YAML anchor `default_protection`. This allows the same set of rules to be reused for multiple branches. - The `main` and `beta` branches are now using the `default_protection` rules. 2. `.github/workflows/testPublish.yml`: This file defines a GitHub Actions workflow. The changes made here include: - The workflow is now triggered on `push` and `pull_request` events not only for the `main` branch but also for the `beta` branch. - The `release` job now runs if the event is a `push` to either the `main` or `beta` branch. 3. `package.json`: This file is used to manage the project's dependencies, scripts, version and more. The changes made here include: - The `release` configuration now includes the `beta` branch in addition to the `main` branch. The `beta` branch is marked as `prerelease`. This means that releases on the `beta` branch will be marked as pre-releases. Changes to be committed: modified: .github/settings.yml modified: .github/workflows/testPublish.yml modified: package.json --- .github/settings.yml | 10 ++++++++-- .github/workflows/testPublish.yml | 6 +++--- package.json | 8 +++++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/settings.yml b/.github/settings.yml index cee9739..2d3b68d 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -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: @@ -60,7 +60,7 @@ 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)","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. @@ -68,6 +68,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: auro-skeleton diff --git a/.github/workflows/testPublish.yml b/.github/workflows/testPublish.yml index 93fd095..701ea3a 100644 --- a/.github/workflows/testPublish.yml +++ b/.github/workflows/testPublish.yml @@ -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: @@ -28,7 +28,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: diff --git a/package.json b/package.json index fc17b2d..6d1b1ea 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,13 @@ }, "release": { "branches": [ - "main" + { + "name": "main" + }, + { + "name": "beta", + "prerelease": true + } ], "plugins": [ "@semantic-release/commit-analyzer",