Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Commit

Permalink
feat: use new pipeline (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored Aug 9, 2022
1 parent 6d18d1e commit 38b7496
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 147 deletions.
8 changes: 6 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.5.0/schema.json",
"changelog": "@changesets/cli/changelog",
"$schema": "https://unpkg.com/@changesets/config@2.1.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "the-guild-org/the-guild-docs" }],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["website"],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
},
"snapshot": {
"useCalculatedVersion": true,
"prereleaseTemplate": "{tag}-{datetime}-{commit}"
}
}
61 changes: 14 additions & 47 deletions .github/workflows/canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,34 @@ on:
pull_request:
branches:
- main
paths:
- '.changeset/**/*.md'

jobs:
publish-canary:
name: Publish Canary
canary:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout Repo
- name: Checkout
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

- name: Setup Node.js 16
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
cache: 'yarn'

- name: Setup NPM credentials
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Cache Yarn
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{runner.os}}-16-${{hashFiles('yarn.lock')}}
restore-keys: |
${{runner.os}}-16-
- name: Install Dependencies
- name: Install Dependencies using Yarn
run: yarn

- name: Release Canary
id: canary
uses: 'kamilkisiela/release-canary@master'
with:
npm-token: ${{ secrets.NPM_TOKEN }}
npm-script: 'yarn release:canary'
changesets: true

- name: Publish a message
if: steps.canary.outputs.released
uses: 'kamilkisiela/pr-comment@master'
with:
message: |
The latest changes of this PR are available as alpha in npm (based on the declared `changesets`):
```
${{ steps.canary.outputs.changesetsPublishedPackages}}
```
bot-token: ${{ secrets.BOT_GH_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish an empty message
if: steps.canary.outputs.released == 'false'
uses: 'kamilkisiela/pr-comment@master'
uses: 'the-guild-org/changesets-snapshot-action@main'
with:
message: The latest changes of this PR are not available as alpha, since there are no linked `changesets` for this PR.
bot-token: ${{ secrets.BOT_GH_TOKEN }}
bot: 'theguild-bot'
github-token: ${{ secrets.GITHUB_TOKEN }}
tag: alpha
prepareScript: 'yarn build'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Dependencies

on: pull_request

jobs:
changeset:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Create/Update Changesets
uses: 'the-guild-org/changesets-dependencies-action@main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37 changes: 21 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,45 @@ on:
- '.husky/**'
branches:
- main

jobs:
release:
name: Release
name: stable
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
- name: Checkout
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

- name: Setup Node.js 16
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache Yarn
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{runner.os}}-16-${{hashFiles('yarn.lock')}}
restore-keys: |
${{runner.os}}-16-
node-version: 18
cache: 'yarn'

- name: Install Dependencies
- name: Install Dependencies using Yarn
run: yarn

- name: Build Packages
run: yarn build

- name: set version variables
id: vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
uses: dotansimha/changesets-action@1bd10e16a393db098c8f537c719621962c0d5571
with:
publish: yarn release
commit: 'chore(release): update monorepo packages versions'
title: Upcoming Release Changes
title: 'Upcoming Release Changes'
createGithubReleases: aggregate
githubReleaseName: 'Release ${{ steps.vars.outputs.sha_short }} (from ${{ steps.vars.outputs.branch }})'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"lint": "eslint --ignore-path .gitignore .",
"postbuild": "node scripts/copy-files.mjs && yarn workspace website build",
"postinstall": "husky install",
"prettier": "prettier --write --list-different .",
"release:canary": "(node scripts/canary-release.mjs && yarn build && changeset publish --tag alpha) || echo Skipping Canary..."
"prettier": "prettier --write --list-different ."
},
"workspaces": [
"packages/*",
"website"
],
"devDependencies": {
"@changesets/cli": "2.24.2",
"@changesets/changelog-github": "0.4.6",
"@theguild/prettier-config": "0.0.2",
"@types/node": "18.6.4",
"@types/react": "18.0.17",
Expand Down
79 changes: 0 additions & 79 deletions scripts/canary-release.mjs

This file was deleted.

54 changes: 53 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,15 @@
dependencies:
"@changesets/types" "^5.1.0"

"@changesets/changelog-github@0.4.6":
version "0.4.6"
resolved "https://registry.yarnpkg.com/@changesets/changelog-github/-/changelog-github-0.4.6.tgz#5880448c578a160c06d8bd804872355ec0745dcb"
integrity sha512-ahR/+o3OPodzfG9kucEMU/tEtBgwy6QoJiWi1sDBPme8n3WjT6pBlbhqNYpWAJKilomwfjBGY0MTUTs6r9d1RQ==
dependencies:
"@changesets/get-github-info" "^0.5.1"
"@changesets/types" "^5.1.0"
dotenv "^8.1.0"

"@changesets/cli@2.24.2":
version "2.24.2"
resolved "https://registry.yarnpkg.com/@changesets/cli/-/cli-2.24.2.tgz#333ad412c821b582680fbc7f0d0596ebba442c2d"
Expand Down Expand Up @@ -901,6 +910,14 @@
fs-extra "^7.0.1"
semver "^5.4.1"

"@changesets/get-github-info@^0.5.1":
version "0.5.1"
resolved "https://registry.yarnpkg.com/@changesets/get-github-info/-/get-github-info-0.5.1.tgz#5a20328b26f301b2193717abb32e73651e8811b7"
integrity sha512-w2yl3AuG+hFuEEmT6j1zDlg7GQLM/J2UxTmk0uJBMdRqHni4zXGe/vUlPfLom5KfX3cRfHc0hzGvloDPjWFNZw==
dependencies:
dataloader "^1.4.0"
node-fetch "^2.5.0"

"@changesets/get-release-plan@^3.0.13":
version "3.0.13"
resolved "https://registry.yarnpkg.com/@changesets/get-release-plan/-/get-release-plan-3.0.13.tgz#f5f7b67b798d1bf2d6e8e546a60c199dd09bfeaf"
Expand Down Expand Up @@ -2011,7 +2028,7 @@ acorn@^7.0.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==

acorn@^8.0.0, acorn@^8.0.4, acorn@^8.7.1, acorn@^8.8.0:
acorn@^8.0.0, acorn@^8.0.4, acorn@^8.8.0:
version "8.8.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8"
integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==
Expand Down Expand Up @@ -3296,6 +3313,11 @@ damerau-levenshtein@^1.0.8:
resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7"
integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==

dataloader@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8"
integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==

debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down Expand Up @@ -3487,6 +3509,11 @@ dot-case@^3.0.4:
no-case "^3.0.4"
tslib "^2.0.3"

dotenv@^8.1.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==

duplexer@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
Expand Down Expand Up @@ -5956,6 +5983,13 @@ no-case@^3.0.4:
lower-case "^2.0.2"
tslib "^2.0.3"

node-fetch@^2.5.0:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"

node-releases@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503"
Expand Down Expand Up @@ -7656,6 +7690,11 @@ tr46@^1.0.1:
dependencies:
punycode "^2.1.0"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==

tree-kill@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc"
Expand Down Expand Up @@ -8029,6 +8068,11 @@ wcwidth@^1.0.1:
dependencies:
defaults "^1.0.3"

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==

webidl-conversions@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad"
Expand All @@ -8049,6 +8093,14 @@ webpack-bundle-analyzer@4.3.0:
sirv "^1.0.7"
ws "^7.3.1"

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

whatwg-url@^7.0.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06"
Expand Down

1 comment on commit 38b7496

@vercel
Copy link

@vercel vercel bot commented on 38b7496 Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

the-guild-docs – ./

the-guild-docs.vercel.app
the-guild-docs-git-main-theguild.vercel.app
the-guild-docs-theguild.vercel.app

Please sign in to comment.