Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seperate version and publish CI actions
- Loading branch information
Showing
3 changed files
with
112 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: publish | ||
|
||
on: | ||
workflow_run: | ||
workflows: [ci] | ||
branches: [next, main] | ||
types: [completed] | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
|
||
jobs: | ||
# Publish the public to npm | ||
npm: | ||
if: github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/next' && github.repository == 'remirror/remirror' | ||
timeout-minutes: 10 | ||
needs: [lint, typecheck, unit_test, build_test, size_check, chromium_e2e, firefox_e2e] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: setup caching | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.PNPM_CACHE_FOLDER }} | ||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm- | ||
- name: setup node.js | ||
uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: 14 | ||
|
||
- name: install and audit | ||
uses: ./.github/actions/pnpm | ||
with: | ||
cache: ${{ env.PNPM_CACHE_FOLDER }} | ||
|
||
- name: build project | ||
run: pnpm build | ||
|
||
- name: publish npm release | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > $HOME/.npmrc | ||
pnpm release | ||
rm $HOME/.npmrc | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: version | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
- next | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
|
||
jobs: | ||
# Update package versions with changesets. | ||
version: | ||
timeout-minutes: 8 | ||
runs-on: ubuntu-latest | ||
if: false == contains(github.ref, 'changeset') && github.repository == 'remirror/remirror' | ||
steps: | ||
- name: checkout code repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: setup caching | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.PNPM_CACHE_FOLDER }} | ||
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm- | ||
- name: setup node.js | ||
uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: 14 | ||
|
||
- name: install and audit | ||
uses: ./.github/actions/pnpm | ||
with: | ||
cache: ${{ env.PNPM_CACHE_FOLDER }} | ||
|
||
- name: check versions are valid | ||
if: github.event.pull_request_target | ||
run: pnpm version:check | ||
|
||
- name: create versions | ||
uses: changesets/action@master | ||
if: github.ref == 'refs/heads/next' | ||
with: | ||
version: pnpm version | ||
commit: 'Update versions with changeset' | ||
title: 'Update versions with changeset' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
6005735
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://remirror.io as production
🚀 Deployed on https://5f819d0bf2fb3ea28dd42fbb--remirror.netlify.app