From 618f950caeec9485982304f5bbb146d171355de6 Mon Sep 17 00:00:00 2001 From: Joseph Flinn <58369717+joseph-flinn@users.noreply.github.com> Date: Thu, 21 Oct 2021 10:31:41 -0700 Subject: [PATCH] Change release branch constraints (#1248) * updating the release branch constraints * updating the self host docker image build and release with the new release branch * renaming the release job for selfhost docker release * removing unneeded line * removing the master branch release ci code execution * updating some verbiage --- .github/workflows/build.yml | 15 +++++++++++++-- .github/workflows/release.yml | 20 +++++++++----------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a88f2336a2..2fc463360a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -228,24 +228,35 @@ jobs: if: github.ref == 'refs/heads/master' run: docker tag bitwarden/web bitwarden/web:dev + - name: Tag release branch + if: github.ref == 'refs/heads/release' + run: docker tag bitwarden/web bitwarden/web:latest + - name: List Docker images if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' run: docker images - - name: Push rc images + - name: Push rc image if: github.ref == 'refs/heads/rc' run: docker push bitwarden/web:rc env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }} - - name: Push dev images + - name: Push dev image if: github.ref == 'refs/heads/master' run: docker push bitwarden/web:dev env: DOCKER_CONTENT_TRUST: 1 DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }} + - name: Push latest image + if: github.ref == 'refs/heads/release' + run: docker push bitwarden/web:latest + env: + DOCKER_CONTENT_TRUST: 1 + DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.setup-dct.outputs.dct-delegate-repo-passphrase }} + - name: Log out of Docker if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' run: docker logout diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fe7cd338f01..617c71d5243 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,9 @@ jobs: steps: - name: Branch check run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]]; then + if [[ "$GITHUB_REF" != "refs/heads/release" ]]; then echo "===================================" - echo "[!] Can only release from rc branch" + echo "[!] Can only release from the 'release' branch" echo "===================================" exit 1 fi @@ -43,7 +43,7 @@ jobs: self-host: - name: Build self-host docker + name: Release self-host docker runs-on: ubuntu-20.04 needs: setup env: @@ -66,20 +66,18 @@ jobs: - name: Checkout repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - name: Pull latest selfhost rc image - run: docker pull bitwarden/web:rc + - name: Pull latest selfhost Release image + run: docker pull bitwarden/web:latest - name: Tag version run: | - docker tag bitwarden/web:rc bitwarden/web:latest - docker tag bitwarden/web:rc bitwarden/web:$_RELEASE_VERSION + docker tag bitwarden/web:latest bitwarden/web:$_RELEASE_VERSION - name: List Docker images run: docker images - name: Push images run: | - docker push bitwarden/web:latest docker push bitwarden/web:$_RELEASE_VERSION env: DOCKER_CONTENT_TRUST: 1 @@ -108,7 +106,7 @@ jobs: run: | git switch -c deploy-$_TAG_VERSION git push -u origin deploy-$_TAG_VERSION - git switch rc + git switch release - name: Setup git config run: | @@ -122,7 +120,7 @@ jobs: with: workflow: build.yml workflow_conclusion: success - branch: rc + branch: release artifacts: web-*-cloud-COMMERCIAL.zip # This should result in a build directory in the current working directory @@ -163,7 +161,7 @@ jobs: with: workflow: build.yml workflow_conclusion: success - branch: rc + branch: release artifacts: "web-*-selfhosted-COMMERCIAL.zip, web-*-selfhosted-open-source.zip"