Skip to content

Commit

Permalink
Add back deployment config
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonmade committed Nov 14, 2023
1 parent 34cbc10 commit e74d8df
Show file tree
Hide file tree
Showing 11 changed files with 224 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
"changelog": ["@changesets/changelog-github", {"repo": "Shopify/remote-ui"}],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @see https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'pnpm'
directory: '/'
schedule:
interval: 'daily'

- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
16 changes: 16 additions & 0 deletions .github/workflows/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Prepare repo
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2.4.0
- uses: actions/setup-node@v2
with:
cache: pnpm
registry-url: 'https://registry.npmjs.org'
node-version-file: '.nvmrc'
- name: Enable Corepack
run: corepack enable && pnpm -v
shell: bash
- name: Install dependencies
run: pnpm install --frozen-lockfile && pnpm prune
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/changesets-reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Changelog Reminder

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'packages/*/source/**'
- 'packages/*/package.json'
- '!*.test.*'
- '!*.md'

jobs:
remind:
name: Changeset Reminder
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ !github.event.pull_request.draft && !startsWith(github.head_ref, 'changeset-release/') }}
steps:
- uses: actions/checkout@v3
- uses: mskelton/changelog-reminder-action@v2
with:
changelogRegex: "\\.changeset"
message: >
We detected some changes in public packages, and there are no updates in the `.changeset` directory.
If the changes are user-facing and should cause a version bump, run `pnpm changeset` to track your changes and include them in the next release CHANGELOG.
If you are making simple updates to repo configuration, examples, or documentation, you do not need to add a changeset.
31 changes: 31 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Changesets

on:
push:
branches: [main]

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
changesets:
name: Changesets 🦋
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
# This (plus the GITHUB_TOKEN on the changeset action) allow other workflows to run on the PR that changesets creates.
token: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}

- uses: ./.github/workflows/actions/prepare
# @see https://github.com/changesets/action
- uses: changesets/action@v1
with:
title: 'Publish packages 🚀'
commit: 'Publish packages'
version: pnpm version-bump
publish: pnpm changeset tag
env:
GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Checks

on:
workflow_call:

jobs:
lint:
name: Lint 💅
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/prepare
- run: pnpm run lint

type-check:
name: Type check 🧮
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/prepare
- run: pnpm run type-check

test:
name: Tests 🧪
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/prepare
- run: pnpm run test
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on:
push:
branches:
- '**'
- '!main'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
checks:
name: Checks 📝
uses: ./.github/workflows/checks.yml
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy

on:
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
checks:
name: Checks 📝
uses: ./.github/workflows/checks.yml

deploy:
name: Deploy 🚀
needs: [checks]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/prepare
- run: pnpm run type-check
- run: pnpm run build
- run: pnpm run deploy
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/preview-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Preview versions

on:
workflow_dispatch:
push:
branches:
- changeset-release/main

jobs:
preview:
name: Preview 🔮
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: ./.github/workflows/actions/prepare

# Changeset entries are consumed on this branch. We need to reset the
# changeset files so that the snapshot command knows the correct packages,
# and does not accidentally publish the new, non-preview version numbers
# prematurely.
- name: Reset changeset entries
run: |
git fetch origin main
git checkout origin/main -- .changeset
- run: pnpm run type-check
- run: pnpm run build

- name: Deploy preview versions to NPM
run: |
pnpm changeset version --snapshot preview
pnpm changeset publish --tag preview --no-git-tag
env:
GITHUB_TOKEN: ${{ secrets.SHOPIFY_GH_ACCESS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.tsdk": "node_modules/typescript/lib"
}

0 comments on commit e74d8df

Please sign in to comment.