Skip to content

Commit

Permalink
ci: migrate snapshot publishing job to GHA
Browse files Browse the repository at this point in the history
Migrate the snapshot publishing job from CircleCI to Github Actions
  • Loading branch information
josephperrott committed Oct 19, 2023
1 parent 78a75fe commit 1d67721
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 44 deletions.
44 changes: 0 additions & 44 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,46 +232,6 @@ jobs:
- run: yarn ci-push-deploy-docs-app
- *slack_notify_on_failure

# ----------------------------------------
# Job that publishes the build snapshots
# ----------------------------------------
publish_snapshots:
<<: *job_defaults
resource_class: xlarge
environment:
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
steps:
- checkout_and_rebase
- *restore_cache
- *attach_release_output
- *setup_bazel_ci_config
- *setup_bazel_remote_execution
- *yarn_install
- *setup_bazel_binary

# CircleCI has a config setting to enforce SSH for all github connections.
# This is not compatible with our mechanism of using a Personal Access Token
# to publish the build snapshots. In order to fix this, we unset the global option.
- run: git config --global --unset "url.ssh://git@git.luolix.top.insteadof"

# The components examples package is not a release package, but we publish it
# as part of this job to the docs-content repository. It's not contained in the
# attached release output, so we need to build it here.
- run: yarn build-docs-content

# Ensures that we do not push the snapshot artifacts upstream until all previous
# snapshot build jobs have completed. This helps avoiding conflicts when multiple
# commits have been pushed (resulting in multiple concurrent snapshot publish jobs).
# We increase the confidence threshold so that it queries the CircleCI API a second time
# after a delay. We do this as the CircleCI API does not refresh immediately when a job
# completes/starts, and this will improve stability of the queue step. See source:
# https://github.com/eddiewebb/circleci-queue/commit/5d42add5bbcff5e8ac7fe189448a61fea98b0839.
- queue/until_front_of_line:
confidence: '2'

- run: ./scripts/circleci/publish-snapshots.sh
- *slack_notify_on_failure

# ----------------------------------------------------------------------------------------
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
# one job depends on another.
Expand All @@ -292,10 +252,6 @@ workflows:
filters: *only_on_pull_requests_filter
requires:
- build_release_packages
- publish_snapshots:
filters: *publish_branches_filter
requires:
- build_release_packages
- deploy_docs_site:
filters: *publish_branches_filter
requires:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,38 @@ jobs:
slack-message: 'Build job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
env:
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

publish_snapshots:
if: ${{ github.event_name == 'push'}}
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9931e1a8d1b62fcd2267e89f9993a494856cc1cd
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@9931e1a8d1b62fcd2267e89f9993a494856cc1cd
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@9931e1a8d1b62fcd2267e89f9993a494856cc1cd
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Build and Verify Release Output
run: yarn build-and-check-release-output
- name: Verify tooling setup
run: yarn check-tooling-setup
- name: Build Docs Content
run: yarn build-docs-content
- name: Build Docs Content
run: yarn build-docs-content
- name: Publish Snapshots
run: ./scripts/circleci/publish-snapshots.sh
env:
SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }}
- name: Notify about failed publish
if: ${{ failure() }}
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
with:
channel-id: 'C015EBF2XB6'
slack-message: 'Snapshot publishing failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
env:
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

0 comments on commit 1d67721

Please sign in to comment.