Skip to content

Commit

Permalink
CI: setup Shipit
Browse files Browse the repository at this point in the history
Closes: #16
  • Loading branch information
mrtnzlml authored and tbergquist-godaddy committed Nov 8, 2019
1 parent e6489c6 commit c0e09a2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/continuous-integration.yml
Expand Up @@ -18,8 +18,6 @@ jobs:
# TODO: remove the `--all` switches when stable
steps:
- uses: actions/checkout@v1
with:
lfs: true
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/npm-publisher.yml
Expand Up @@ -6,6 +6,7 @@ on:
- master

env:
CI: true
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

jobs:
Expand All @@ -14,8 +15,6 @@ jobs:

steps:
- uses: actions/checkout@v1
with:
lfs: true
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
Expand All @@ -24,5 +23,3 @@ jobs:
run: |
yarn install --frozen-lockfile
yarn monorepo-babel-node scripts/publishNPMPackages.js
env:
CI: true
28 changes: 28 additions & 0 deletions .github/workflows/shipit.yml
@@ -0,0 +1,28 @@
name: Shipit

on:
push:
branches:
- master

env:
CI: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: run Shipit
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_SHIPIT_PRIVATE_KEY }}" | tr -d '\r' > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H 'github.com' >> ~/.ssh/known_hosts
yarn install --frozen-lockfile
yarn monorepo-babel-node src/monorepo-shipit/bin/shipit.js
19 changes: 8 additions & 11 deletions src/monorepo-shipit/config/__tests__/example-relay.test.js
Expand Up @@ -5,19 +5,16 @@ import path from 'path';
import testExportedPaths from './testExportedPaths';

testExportedPaths(path.join(__dirname, '..', 'example-relay.js'), [
['src/incubator/example-relay/package.json', 'package.json'],
['src/incubator/example-relay/pages/index.js', 'pages/index.js'],
['src/incubator/example-relay/src/locations/CountryFlag.js', 'src/locations/CountryFlag.js'],
[
'src/incubator/example-relay/__generated__/AppQuery.graphql.js',
'__generated__/AppQuery.graphql.js',
],
['src/incubator/example-relay/__github__/.flowconfig', '.flowconfig'],
['src/incubator/example-relay/__github__/babel.config.js', 'babel.config.js'],
['src/incubator/example-relay/.babelrc.js', undefined], // correctly deleted
['src/example-relay/package.json', 'package.json'],
['src/example-relay/pages/index.js', 'pages/index.js'],
['src/example-relay/src/locations/CountryFlag.js', 'src/locations/CountryFlag.js'],
['src/example-relay/__generated__/AppQuery.graphql.js', '__generated__/AppQuery.graphql.js'],
['src/example-relay/__github__/.flowconfig', '.flowconfig'],
['src/example-relay/__github__/babel.config.js', 'babel.config.js'],
['src/example-relay/.babelrc.js', undefined], // correctly deleted

// invalid cases:
['src/incubator/example-relay/__github__/unknown.js', undefined], // correctly deleted
['src/example-relay/__github__/unknown.js', undefined], // correctly deleted
['src/packages/monorepo/outsideScope.js', undefined], // correctly deleted
['package.json', undefined], // correctly deleted
]);
6 changes: 3 additions & 3 deletions src/monorepo-shipit/config/example-relay.js
Expand Up @@ -8,9 +8,9 @@ module.exports = {
},
getPathMappings(): Map<string, string> {
return new Map([
['src/incubator/example-relay/__github__/.flowconfig', '.flowconfig'],
['src/incubator/example-relay/__github__/babel.config.js', 'babel.config.js'],
['src/incubator/example-relay/', ''],
['src/example-relay/__github__/.flowconfig', '.flowconfig'],
['src/example-relay/__github__/babel.config.js', 'babel.config.js'],
['src/example-relay/', ''],
]);
},
getStrippedFiles(): Set<RegExp> {
Expand Down

0 comments on commit c0e09a2

Please sign in to comment.