Skip to content

Commit eceefd9

Browse files
committed
ci: migrate snapshot publishing job to GHA
Migrate the snapshot publishing job from CircleCI to Github Actions (cherry picked from commit 1d67721)
1 parent aa64b71 commit eceefd9

File tree

2 files changed

+35
-44
lines changed

2 files changed

+35
-44
lines changed

.circleci/config.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -232,46 +232,6 @@ jobs:
232232
- run: yarn ci-push-deploy-docs-app
233233
- *slack_notify_on_failure
234234

235-
# ----------------------------------------
236-
# Job that publishes the build snapshots
237-
# ----------------------------------------
238-
publish_snapshots:
239-
<<: *job_defaults
240-
resource_class: xlarge
241-
environment:
242-
GCP_DECRYPT_TOKEN: *gcp_decrypt_token
243-
steps:
244-
- checkout_and_rebase
245-
- *restore_cache
246-
- *attach_release_output
247-
- *setup_bazel_ci_config
248-
- *setup_bazel_remote_execution
249-
- *yarn_install
250-
- *setup_bazel_binary
251-
252-
# CircleCI has a config setting to enforce SSH for all github connections.
253-
# This is not compatible with our mechanism of using a Personal Access Token
254-
# to publish the build snapshots. In order to fix this, we unset the global option.
255-
- run: git config --global --unset "url.ssh://[email protected]"
256-
257-
# The components examples package is not a release package, but we publish it
258-
# as part of this job to the docs-content repository. It's not contained in the
259-
# attached release output, so we need to build it here.
260-
- run: yarn build-docs-content
261-
262-
# Ensures that we do not push the snapshot artifacts upstream until all previous
263-
# snapshot build jobs have completed. This helps avoiding conflicts when multiple
264-
# commits have been pushed (resulting in multiple concurrent snapshot publish jobs).
265-
# We increase the confidence threshold so that it queries the CircleCI API a second time
266-
# after a delay. We do this as the CircleCI API does not refresh immediately when a job
267-
# completes/starts, and this will improve stability of the queue step. See source:
268-
# https://github.com/eddiewebb/circleci-queue/commit/5d42add5bbcff5e8ac7fe189448a61fea98b0839.
269-
- queue/until_front_of_line:
270-
confidence: '2'
271-
272-
- run: ./scripts/circleci/publish-snapshots.sh
273-
- *slack_notify_on_failure
274-
275235
# ----------------------------------------------------------------------------------------
276236
# Workflow definitions. A workflow usually groups multiple jobs together. This is useful if
277237
# one job depends on another.
@@ -292,10 +252,6 @@ workflows:
292252
filters: *only_on_pull_requests_filter
293253
requires:
294254
- build_release_packages
295-
- publish_snapshots:
296-
filters: *publish_branches_filter
297-
requires:
298-
- build_release_packages
299255
- deploy_docs_site:
300256
filters: *publish_branches_filter
301257
requires:

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,38 @@ jobs:
235235
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 }}'
236236
env:
237237
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
238+
239+
publish_snapshots:
240+
if: ${{ github.event_name == 'push'}}
241+
runs-on: ubuntu-latest-4core
242+
steps:
243+
- name: Initialize environment
244+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@9931e1a8d1b62fcd2267e89f9993a494856cc1cd
245+
with:
246+
cache-node-modules: true
247+
- name: Setup Bazel
248+
uses: angular/dev-infra/github-actions/bazel/setup@9931e1a8d1b62fcd2267e89f9993a494856cc1cd
249+
- name: Setup Bazel RBE
250+
uses: angular/dev-infra/github-actions/bazel/configure-remote@9931e1a8d1b62fcd2267e89f9993a494856cc1cd
251+
- name: Install node modules
252+
run: yarn install --frozen-lockfile
253+
- name: Build and Verify Release Output
254+
run: yarn build-and-check-release-output
255+
- name: Verify tooling setup
256+
run: yarn check-tooling-setup
257+
- name: Build Docs Content
258+
run: yarn build-docs-content
259+
- name: Build Docs Content
260+
run: yarn build-docs-content
261+
- name: Publish Snapshots
262+
run: ./scripts/circleci/publish-snapshots.sh
263+
env:
264+
SNAPSHOT_BUILDS_GITHUB_TOKEN: ${{ secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN }}
265+
- name: Notify about failed publish
266+
if: ${{ failure() }}
267+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v=v1.24.0
268+
with:
269+
channel-id: 'C015EBF2XB6'
270+
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 }}'
271+
env:
272+
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}

0 commit comments

Comments
 (0)