Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:Esri/calcite-components into epic/71…
Browse files Browse the repository at this point in the history
…80-component-tokens

# Conflicts:
#	packages/calcite-components/src/components.d.ts
#	packages/calcite-components/src/components/action-bar/action-bar.tsx
#	packages/calcite-components/src/components/action-pad/action-pad.tsx
#	packages/calcite-components/src/components/list-item/list-item.scss
#	packages/calcite-components/src/components/panel/panel.scss
#	packages/calcite-components/src/components/split-button/split-button.e2e.ts
  • Loading branch information
alisonailea committed Jun 10, 2024
2 parents b34aff3 + bc2c2c6 commit 4395f91
Show file tree
Hide file tree
Showing 165 changed files with 1,755 additions and 1,461 deletions.
57 changes: 57 additions & 0 deletions .github/scripts/publishPrerelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash

if [ "$BRANCH" = "dev" ]; then
if [ "$NEXT_RELEASE_ENABLED" != "true" ]; then
echo "Next release is disabled"
exit 0
fi

if ! npm run util:is-next-deployable; then
echo "No deployable changes in dev"
exit 0
fi
fi

npm install

# version the packages with lerna before building to ensure the version in
# Calcite components' source code preamble is correct for deployment
if [ "$BRANCH" = "dev" ]; then
npm run version:next
elif [ "$BRANCH" = "main" ]; then
npm run version:hotfix
elif [ "$BRANCH" = "rc" ]; then
npm run version:rc
fi

npm run build
npm test

git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

# make sure the committed, autogenerated files are up to date before releasing.
# The "|| true" prevents failure if there are no changes.
git add packages/calcite-components/src/components.d.ts package-lock.json || true
git commit -m "build: update types and package-lock" || true

# try deploying storybook, but still release next if it fails with "|| true"
if [ "$BRANCH" = "main" ]; then
{ npm run --workspace=@esri/calcite-components build-storybook &&
npx --workspace=@esri/calcite-components storybook-to-ghpages \
--host-token-env-variable=GH_TOKEN_FOR_STORYBOOK \
--existing-output-dir=docs --ci; } || true

# remove the built docs after storybook deploys to gh-pages
git reset --hard
fi

if [ "$BRANCH" = "main" ]; then
npm run publish:next
elif [ "$BRANCH" = "dev" ]; then
npm run publish:hotfix
elif [ "$BRANCH" = "rc" ]; then
npm run publish:rc
fi

npm run util:push-tags
4 changes: 2 additions & 2 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Chromatic
on:
push:
branches: [main, hotfix, rc]
branches: [main, rc, dev]
pull_request:
branches: [main, hotfix, rc]
branches: [main, rc, dev]
types: [labeled, synchronize]
jobs:
run:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [main, rc]
branches: [main, rc, dev]
pull_request:
# The branches below must be a subset of the branches above
branches: [main, rc]
branches: [main, rc, dev]
schedule:
- cron: "19 2 * * 4"

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy Latest
on:
workflow_dispatch:
push:
branches: [main, hotfix]
branches: [main]
permissions:
contents: write
pull-requests: write
Expand Down Expand Up @@ -60,7 +60,8 @@ jobs:
git commit -m "build: update types and package-lock" || true
npm run publish:latest
npm run util:upload-release-assets -- "${{ steps.release.outputs.paths_released }}"
npm run util:upload-release-assets -- "$RELEASED_PATHS"
env:
RELEASED_PATHS: ${{ toJSON(steps.release.outputs.paths_released) }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
68 changes: 0 additions & 68 deletions .github/workflows/deploy-next.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/deploy-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Prerelease
concurrency:
group: deploy_prerelease
cancel-in-progress: true
on:
# `next` versions are automatically released when deployabled commits are pushed to dev
push:
branches: [dev]
# `hotfix` and `rc` versions must be manually released:
# https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.ADMIN_TOKEN }}
ref: ${{ github.base_ref || github.ref_name }}
- uses: actions/setup-node@v4
with:
node-version-file: package.json
registry-url: "https://registry.npmjs.org"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy prerelease and storybook
env:
NEXT_RELEASE_ENABLED: ${{ secrets.NEXT_RELEASE_ENABLED }}
# https://github.com/storybookjs/storybook-deployer/issues/77#issuecomment-618560481
GH_TOKEN_FOR_STORYBOOK: ${{ github.actor }}:${{ secrets.ADMIN_TOKEN }}
NPM_CONFIG_PROVENANCE: true
BRANCH: ${{ github.base_ref || github.ref_name }}
run: "${{ github.workspace }}/.github/scripts/publishPrerelease.sh"
- name: notify teams
uses: toko-bifrost/ms-teams-deploy-card@3.1.2
if: ${{ !cancelled() && github.event_name == 'push' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-uri: ${{ secrets.TEAMS_WEBHOOK_URI_BUILD }}
show-on-start: false
card-layout-exit: complete
timezone: America/Los_Angeles
2 changes: 1 addition & 1 deletion .github/workflows/pr-bot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PR Bot
on:
pull_request:
branches: [main, rc, hotfix]
branches: [main, rc, dev]
permissions:
pull-requests: write
issues: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: E2E
on:
workflow_dispatch:
pull_request:
branches: [main, rc, hotfix]
branches: [main, rc, dev]
jobs:
e2e:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-milestone.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: PR Merged
on:
pull_request:
branches: [main, rc]
branches: [main, rc, dev]
types: [closed]
jobs:
milestone:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/remove-prerelease-changelog-entries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ on:
push:
branches:
- release-please--branches--main
- release-please--branches--hotfix
permissions:
contents: write
pull-requests: write
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/schedule-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Schedule Updates
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
- cron: "0 0 * * 1,4"
jobs:
component-docs:
runs-on: ubuntu-latest
Expand All @@ -19,10 +19,13 @@ jobs:
npx --workspace=@esri/calcite-components stencil build --docs
npm run --workspace=@esri/calcite-components lint:md
- name: Commit and create pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
base: main
branch: ci/update-component-docs
delete-branch: true
add-paths: |
**/*.md
commit-message: "docs: update component READMEs"
token: ${{ secrets.ADMIN_TOKEN }}
title: "docs: update component READMEs"
Expand All @@ -45,10 +48,11 @@ jobs:
git config --global user.name "github-actions[bot]"
npx update-browserslist-db@latest
- name: Commit and create pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
base: main
branch: ci/update-browserslist-db
delete-branch: true
commit-message: "build: update browserslist db"
title: "build: update browserslist db"
body: "This PR was automatically generated by the update-browserslist-db GitHub action"
Expand Down
2 changes: 1 addition & 1 deletion documentation/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ A `remove-prerelease-changelog-entries.yml` GitHub Action runs the `removePrerel

### Steps to release

For the most part the releases are automated in the CI (see the sections above). However, there are a few manual steps, which are described in the [releasing documentation](/Releasing.md).
For the most part the releases are automated in the CI (see the sections above). However, there are a few manual steps, which are described in the [releasing documentation](./releasing.md).
Loading

0 comments on commit 4395f91

Please sign in to comment.