Skip to content

Commit

Permalink
chore: use dripip for making releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed May 29, 2020
1 parent cf90a8e commit 9a8d1a3
Show file tree
Hide file tree
Showing 4 changed files with 482 additions and 3,042 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: trunk

on:
pull_request:
branches: [master]

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10.x, 12.x, 14.x]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn build
- run: yarn test
- run: yarn lint
33 changes: 21 additions & 12 deletions .github/workflows/release.yml → .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: release
on: [push, pull_request]
name: trunk

on:
push:
branches: [master]

jobs:
test:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['10', '12', '14']
node: [10.x, 12.x, 14.x]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
Expand All @@ -24,15 +27,17 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn test:ci
- run: yarn build
- run: yarn test
- run: yarn lint
release:
needs: [test]
needs: [tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10.x'
fetch-depth: 0
- uses: actions/setup-node@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
Expand All @@ -44,8 +49,12 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- run: yarn build
- run: yarn semantic-release
- name: Make release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
yarn -s dripip preview --json > result.json
echo '==> Publish Result'
jq '.' < result.json
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-request",
"version": "0.0.0-semantic-release",
"version": "0.0.0-dripip",
"main": "dist/index.js",
"files": [
"dist"
Expand All @@ -22,7 +22,7 @@
"graphql-client",
"apollo"
],
"author": "Johannes Schickling <johannes@graph.cool>",
"author": "Prisma Labs Team",
"license": "MIT",
"bugs": {
"url": "https://github.com/prisma/graphql-request/issues"
Expand All @@ -38,9 +38,10 @@
"prepublish": "npm run build",
"build": "rm -rf dist && tsc -d",
"lint": "tslint --project . {examples,src,test}/**/*.ts",
"test": "yarn lint && yarn build && jest",
"test:ci": "yarn test && bundlesize",
"semantic-release": "semantic-release"
"test": "jest",
"release:stable": "dripip stable",
"release:preview": "dripip preview",
"release:pr": "dripip pr"
},
"dependencies": {
"cross-fetch": "^3.0.4"
Expand All @@ -54,11 +55,11 @@
"@types/node": "10.17.24",
"body-parser": "^1.19.0",
"bundlesize": "^0.18.0",
"dripip": "^0.9.0",
"express": "^4.17.1",
"fetch-cookie": "0.7.2",
"jest": "^26.0.1",
"prettier": "^2.0.5",
"semantic-release": "17.0.8",
"ts-jest": "^26.0.0",
"tslint": "5.11.0",
"tslint-config-standard": "8.0.1",
Expand Down
Loading

0 comments on commit 9a8d1a3

Please sign in to comment.