Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: apply KAIO updates #3

Merged
merged 9 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .buildkite/dockerfiles/release.Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions .buildkite/pipeline.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions .buildkite/scripts/helpers/get-secret.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .buildkite/scripts/helpers/setup-registry.sh

This file was deleted.

98 changes: 0 additions & 98 deletions .buildkite/scripts/release.sh

This file was deleted.

21 changes: 0 additions & 21 deletions .buildkite/scripts/run-playwright.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .changeset/curvy-kiwis-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
44 changes: 44 additions & 0 deletions .github/actions/branch-preview/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# this is composite workflow that gets the repo ready for actions
# for docs how composite workflows work see https://wallis.dev/blog/composite-github-actions

name: Add branch preview link to a PR comment
description: Adds or updates a branch preview link to a PR
inputs:
prNumber:
required: true
description: PR number
commitSha:
required: true
description: Commit SHA that triggered the workflow
commitMessage:
required: true
description: Commit message that triggered the workflow
storybookUrl:
required: true
description: The storybook url from Chromatic

runs:
using: composite
steps:
- name: Find comment
id: findComment
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ inputs.prNumber }}
comment-author: "github-actions[bot]"
body-includes: ":sparkles: Here is your branch preview! :sparkles:"

- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.findComment.outputs.comment-id }}
issue-number: ${{ inputs.prNumber }}
edit-mode: replace
body: |
:sparkles: Here is your branch preview! :sparkles:

- [Storybook][1]

Last updated for commit ${{ inputs.commitSha }}: ${{ inputs.commitMessage }}

[1]: ${{ inputs.storybookUrl }}
21 changes: 21 additions & 0 deletions .github/actions/playwright/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# this is composite workflow that gets the repo ready for actions
# for docs how composite workflows work see https://wallis.dev/blog/composite-github-actions

name: Install Playwright
description: Dependency for storybook/test-runner

runs:
using: composite
steps:
- name: Cache Playwright
id: playwright-cache
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: kaizen-${{ runner.os }}-playwright-${{ hashFiles('./yarn.lock') }}
- if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
shell: bash
- if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps
shell: bash
29 changes: 29 additions & 0 deletions .github/workflows/canary-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Canary release"

on:
workflow_dispatch:
inputs:
label:
description: 'Pick a label for the release, to be included in the version number — e.g. "fix-button-focus" will released as "@kaizen/[email protected]"'
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
LABEL: ${{ github.event.inputs.label }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Create Release Pull Request or Publish to npm
id: changesets
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
- run: |
echo "Releasing canary for $LABEL"
yarn build
yarn changeset version --snapshot "$LABEL"
yarn changeset publish --tag "$LABEL"
16 changes: 12 additions & 4 deletions .github/workflows/changeset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ on:
jobs:
version:
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- name: Create Release Pull Request
uses: changesets/action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create Release Pull Request or Publish to npm
id: changesets
run: |
npm config set "//registry.npmjs.org/:_authToken" "$NPM_TOKEN"
- uses: changesets/action@v1
with:
title: "Changeset: Version packages"
commit: "version packages"
version: yarn ci:version
publish: yarn ci:publish
- run: git push --follow-tags
18 changes: 17 additions & 1 deletion .github/workflows/check-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ on:
push:
branches-ignore:
- "main"
- "changeset-release/*"

# When Changesets opens a PR it does not trigger GitHub actions,
# because its token does not have permission to. This is a hack
# to allow one of us to trigger GitHub actions for a changesets PR
# by enabling automerge on the PR.
pull_request_target:
types:
- auto_merge_enabled
branches:
- main # the target branch of the PR
paths:
- "**/CHANGELOG.md" # only changesets releases touch changelogs

jobs:
changesets-exists:
if: github.head_ref != 'changeset-release/main'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -16,13 +28,17 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/setup
- run: yarn changeset status --since=origin/main

yarn-integrity:
if: github.head_ref != 'changeset-release/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn check --integrity

verify-build:
if: github.head_ref != 'changeset-release/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand Down
Loading