Browse Source

Point workflows to main (#190)

pull/191/head
Joseph Flinn 2 years ago committed by GitHub
parent
commit
83a8618021
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      .github/workflows/build-unified.yml
  2. 12
      .github/workflows/release.yml
  3. 2
      .github/workflows/update-versions.yml

18
.github/workflows/build-unified.yml

@ -10,16 +10,16 @@ on: @@ -10,16 +10,16 @@ on:
inputs:
server_branch:
type: string
default: master
default: main
is_workflow_call:
type: boolean
default: true
workflow_dispatch:
inputs:
server_branch:
description: "Server branch name to deploy (examples: 'master', 'rc', 'feature/sm')"
description: "Server branch name to deploy (examples: 'main', 'rc', 'feature/sm')"
type: string
default: master
default: main
pull_request:
paths:
- ".github/workflows/build-unified.yml"
@ -38,7 +38,7 @@ jobs: @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: bitwarden/self-host
ref: master
ref: main
- name: Checkout Repository - workflow_dispatch
if: ${{ inputs.is_workflow_call != true }}
@ -50,19 +50,19 @@ jobs: @@ -50,19 +50,19 @@ jobs:
SERVER_BRANCH: ${{ inputs.server_branch }}
run: |
if [[ -z "${SERVER_BRANCH}" ]]; then
echo "server_branch=master" >> $GITHUB_OUTPUT
echo "server_branch=main" >> $GITHUB_OUTPUT
else
echo "server_branch=${SERVER_BRANCH#refs/heads/}" >> $GITHUB_OUTPUT
fi
- name: Check Branch to Publish
env:
PUBLISH_BRANCHES: "master,rc,hotfix-rc"
PUBLISH_BRANCHES: "main,rc,hotfix-rc"
SERVER_BRANCH: ${{ steps.server-branch-name.outputs.server_branch }}
id: publish-branch-check
run: |
if [[ "${{ inputs.is_workflow_call }}" == "true" ]]; then
REF=master
REF=main
else
REF=${GITHUB_REF#refs/heads/}
fi
@ -117,7 +117,7 @@ jobs: @@ -117,7 +117,7 @@ jobs:
SERVER_BRANCH: ${{ steps.server-branch-name.outputs.server_branch }}
run: |
IMAGE_TAG=$(echo "${SERVER_BRANCH}" | sed "s#/#-#g") # slash safe branch name
if [[ "${IMAGE_TAG}" == "master" ]]; then
if [[ "${IMAGE_TAG}" == "main" ]]; then
IMAGE_TAG=dev
elif [[ ("${IMAGE_TAG}" == "rc") || ("${IMAGE_TAG}" == "hotfix-rc") ]]; then
IMAGE_TAG=beta
@ -173,7 +173,7 @@ jobs: @@ -173,7 +173,7 @@ jobs:
steps:
- name: Check if any job failed
if: |
github.ref == 'refs/heads/master'
github.ref == 'refs/heads/main'
|| github.ref == 'refs/heads/rc'
|| github.ref == 'refs/heads/hotfix-rc'
env:

12
.github/workflows/release.yml

@ -31,9 +31,9 @@ jobs: @@ -31,9 +31,9 @@ jobs:
- name: Branch check
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
run: |
if [[ "$GITHUB_REF" != "refs/heads/master" ]]; then
if [[ "$GITHUB_REF" != "refs/heads/main" ]]; then
echo "==================================="
echo "[!] Can only release from the 'master' branch"
echo "[!] Can only release from the 'main' branch"
echo "==================================="
exit 1
fi
@ -74,7 +74,7 @@ jobs: @@ -74,7 +74,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: master
ref: main
- name: Create release
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
@ -102,7 +102,7 @@ jobs: @@ -102,7 +102,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: master
ref: main
- name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
@ -155,7 +155,7 @@ jobs: @@ -155,7 +155,7 @@ jobs:
- release
env:
_CORE_RELEASE_TAG: ${{ needs.setup.outputs._CORE_RELEASE_TAG }}
_BRANCH_NAME: master
_BRANCH_NAME: main
strategy:
fail-fast: false
matrix:
@ -187,7 +187,7 @@ jobs: @@ -187,7 +187,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: master
ref: main
- name: Login to Azure - Prod Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7

2
.github/workflows/update-versions.yml

@ -8,7 +8,7 @@ on: @@ -8,7 +8,7 @@ on:
jobs:
setup:
name: Setup
if: github.ref_name == 'master'
if: github.ref_name == 'main'
runs-on: ubuntu-22.04
outputs:
core_version: ${{ steps.get-core.outputs.version }}

Loading…
Cancel
Save