Skip to content

Commit

Permalink
Add GH workflow to publish canary releases.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterp committed May 10, 2020
1 parent bcfb26a commit 711c520
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish-npm-canary.yaml
@@ -0,0 +1,43 @@
# TODO: Figure out how to make this workflow depend on the build, lint, test
# workflow. Then we don't have to double down on these run tasks.

name: Publish canaray packages to npm

on:
push:
branches: [master]
tags-ignore: [v*] # We do not want to publish a canary release when we're publish an actual release

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Required because lerna uses tags to determine the version.
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Print node and yarn versions
run: |
node --version
yarn --version
- name: Install dependencies
run: yarn install --frozen-lockfile --check-files
- name: Run ESLint
run: yarn lint
env:
CI: true
- name: Build
run: yarn build
- name: Run tests
run: yarn test
env:
CI: true
- name: Publish to npm
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > .npmrc
./tasks/publish-canary
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
7 changes: 4 additions & 3 deletions packages/eslint-config/index.js
Expand Up @@ -12,8 +12,9 @@

let supportRedwoodAutoPageImports = false
try {
// This will throw if the module cannot be resolved, it will not
// resolve if the module is not built, in which case we're probably
// This will throw if the module cannot be resolved,
// it will not resolve if the module is not built,
// in which case we're probably
// building the framework and don't need this plugin.
require.resolve('@redwoodjs/eslint-plugin-redwood')
supportRedwoodAutoPageImports = {
Expand All @@ -37,7 +38,7 @@ module.exports = {
'react',
'react-hooks',
'jest-dom',
supportRedwoodAutoPageImports && '@redwoodjs/redwood', // @redwoodjs/redwood-eslint-plugin
supportRedwoodAutoPageImports && '@redwoodjs/eslint-plugin-redwood',
].filter(Boolean),
ignorePatterns: ['node_modules', 'dist'],
extends: [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Expand Up @@ -4,7 +4,7 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@redwoodjs/eslint-plugin-redwood": "^0.4.0",
"@redwoodjs/eslint-plugin-redwood": "0.6.0",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"babel-eslint": "^10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion tasks/publish-canary
@@ -1,7 +1,7 @@
#!/bin/bash

# This publishes a "canary" version of our packages to npm.
# It is intended to be run when a package is merged to master.
# It is run when a branch is merged to master.
# https://github.com/lerna/lerna/tree/master/commands/publish#--canary

yarn lerna publish --force-publish --canary --preid canary --dist-tag canary --yes
5 changes: 0 additions & 5 deletions yarn.lock
Expand Up @@ -2306,11 +2306,6 @@
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=

"@redwoodjs/eslint-plugin-redwood@^0.4.0":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@redwoodjs/eslint-plugin-redwood/-/eslint-plugin-redwood-0.4.0.tgz#0f89655811c09f662bcdc92596de01575b5af796"
integrity sha512-yF2gIBhg/AipzXGIZP+u1+OjwZrIuOTm3KEhADm26Qxri87WgHLFuPdyN3LYEjew71qIb0Q9OUQqgPMSNwxYfg==

"@rollup/plugin-commonjs@11.0.1":
version "11.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-11.0.1.tgz#6056a6757286901cc6c1599123e6680a78cad6c2"
Expand Down

0 comments on commit 711c520

Please sign in to comment.