Skip to content

Commit

Permalink
chore: publish from package
Browse files Browse the repository at this point in the history
  • Loading branch information
thibremy committed Oct 1, 2020
1 parent 7c4bea3 commit d6e54cb
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 10 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deploy-playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy playground

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment <canary|rc|production>'
required: true
default: 'canary'
jobs:
canary:
runs-on: ubuntu-latest
if: contains(github.event.inputs.environment, 'canary')
steps:
- uses: actions/checkout@master
- run: npm ci
- run: npm run bootstrap
- run: npm run build
- working-directory: playground/basic
run: mv wrangler.example.toml wrangler.toml
- name: Publish playground/basic
uses: cloudflare/[email protected]
env:
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
with:
workingDirectory: playground/basic
apiToken: ${{ secrets.CF_DEPLOY_API_TOKEN }}
environment: ${{ github.event.inputs.environment }}
13 changes: 4 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run bootstrap
- run: npx hygen npmrc npm --authToken ${{ secrets.NPM_PUBLISH_TOKEN }}
- env:
NODE_ENV: production
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
dist-tag: ${{ github.event.inputs.dist-tag }}
run: ./node_modules/.bin/lerna exec "npm publish --tag ${{ env.dist-tag }}" --no-bail
run: ./node_modules/.bin/lerna publish from-package --yes --no-verify-access

publish-github:
runs-on: ubuntu-latest
Expand All @@ -44,14 +44,9 @@ jobs:
node-version: 14
- run: npm ci
- run: npm run bootstrap
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
scope: thibremy
- run: npx hygen npmrc github --authToken ${{ secrets.GITHUB_TOKEN }}
- env:
NODE_ENV: production
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dist-tag: ${{ github.event.inputs.dist-tag }}
run: ./node_modules/.bin/lerna exec "npm publish --tag ${{ env.dist-tag }}" --no-bail
run: ./node_modules/.bin/lerna publish from-package --yes --no-verify-access

5 changes: 5 additions & 0 deletions _templates/generator/help/index.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
message: |
hygen {bold generator new} --name [NAME] --action [ACTION]
hygen {bold generator with-prompt} --name [NAME] --action [ACTION]
---
18 changes: 18 additions & 0 deletions _templates/generator/new/hello.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
to: _templates/<%= name %>/<%= action || 'new' %>/hello.ejs.t
---
---
to: app/hello.js
---
const hello = ```
Hello!
This is your first hygen template.

Learn what it can do here:

https://github.com/jondot/hygen
```

console.log(hello)


18 changes: 18 additions & 0 deletions _templates/generator/with-prompt/hello.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
to: _templates/<%= name %>/<%= action || 'new' %>/hello.ejs.t
---
---
to: app/hello.js
---
const hello = ```
Hello!
This is your first prompt based hygen template.

Learn what it can do here:

https://github.com/jondot/hygen
```

console.log(hello)


14 changes: 14 additions & 0 deletions _templates/generator/with-prompt/prompt.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
to: _templates/<%= name %>/<%= action || 'new' %>/prompt.js
---

// see types of prompts:
// https://github.com/enquirer/enquirer/tree/master/examples
//
module.exports = [
{
type: 'input',
name: 'message',
message: "What's your message?"
}
]
7 changes: 7 additions & 0 deletions _templates/npmrc/github/npmrc.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
to: .npmrc
authToken: <%= process.env.GH_NODE_AUTH_TOKEN %>
---
//npm.pkg.github.com/:_authToken=<%= authToken %>
@thibremy:registry=https://npm.pkg.github.com/thibremy
registry=https://npm.pkg.github.com/thibremy
6 changes: 6 additions & 0 deletions _templates/npmrc/npm/npmrc.ejs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
to: .npmrc
authToken: <%= process.env.NODE_AUTH_TOKEN %>
---
//registry.npmjs.org/:_authToken=<%= authToken %>
@thibremy:registry=https://registry.npmjs.org/
5 changes: 5 additions & 0 deletions packages/vitale-composable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"prettier": "^2.0.5",
"tsup": "^3.6.1",
"vite": "^1.0.0-rc.4"
},
"repository": {
"type": "git",
"url": "https://github.com/thibremy/vitale",
"directory": "packages/vitale-composable"
}
}
5 changes: 5 additions & 0 deletions packages/vitale-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@
"dependencies": {
"voie-pages": "^0.4.0",
"vue-router": "^4.0.0-beta.4"
},
"repository": {
"type": "git",
"url": "https://github.com/thibremy/vitale",
"directory": "packages/vitale-pages"
}
}
5 changes: 5 additions & 0 deletions packages/vitale-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,10 @@
"@cloudflare/kv-asset-handler": "0.0.12",
"dataloader": "^2.0.0",
"graphql": "^15.3.0"
},
"repository": {
"type": "git",
"url": "https://github.com/thibremy/vitale",
"directory": "packages/vitale-worker"
}
}
5 changes: 5 additions & 0 deletions packages/vitale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,10 @@
"prettier": "^2.0.5",
"tsup": "^3.6.1",
"vite": "^1.0.0-rc.4"
},
"repository": {
"type": "git",
"url": "https://github.com/thibremy/vitale",
"directory": "packages/vitale-vite"
}
}
5 changes: 5 additions & 0 deletions packages/vite-plugin-vitale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
"prettier": "^2.0.5",
"tsup": "^3.6.1",
"vite": "^1.0.0-rc.4"
},
"repository": {
"type": "git",
"url": "https://github.com/thibremy/vitale",
"directory": "packages/vite-plugin-vitale"
}
}
11 changes: 10 additions & 1 deletion playground/basic/wrangler.example.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "vitale-playground-basic"
name = "vitale-playground-basic-dev"
type = "javascript"
zone_id = ""
account_id = ""
Expand All @@ -8,3 +8,12 @@ workers_dev = true
[site]
bucket = "./dist"
entry-point = "./dist/_assets/dist-worker"

[env.canary]
name = "vitale-playground-canary"

[env.production]
name = "vitale-playground-basic"

[env.rc]
name = "vitale-playground-basic-rc"

0 comments on commit d6e54cb

Please sign in to comment.