-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cd): add CD pipeline for npm release (#75)
* squash branch 2 * remove trailing whitespace * rename ci job * revert port number changes
- Loading branch information
1 parent
e5624a1
commit 6e3a35c
Showing
4 changed files
with
79 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: cd-dgraph-js-http | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releasetag: | ||
description: "git tag to checkout and version to publish to npm" | ||
required: true | ||
type: string | ||
jobs: | ||
dgraph-js-http-tests: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node-version: [16.x, 18.x, 19.x, 20.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
steps: | ||
- name: Checkout dgraph-js-http repo | ||
uses: actions/checkout@v3 | ||
with: | ||
path: dgraph-js-http | ||
repository: dgraph-io/dgraph-js-http | ||
ref: ${{ github.event.inputs.releasetag }} | ||
- name: Checkout dgraph repo | ||
uses: actions/checkout@v3 | ||
with: | ||
path: dgraph | ||
repository: dgraph-io/dgraph | ||
ref: main | ||
- name: Get Go Version | ||
run: | | ||
#!/bin/bash | ||
cd dgraph | ||
GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) | ||
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOVERSION }} | ||
- name: Build dgraph binary | ||
run: cd dgraph && make docker-image # also builds dgraph binary | ||
- name: Move dgraph binary to gopath | ||
run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph | ||
- name: Setup node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
cache-dependency-path: dgraph-js-http/package-lock.json | ||
- name: Run dgraph-js-http tests | ||
working-directory: dgraph-js-http | ||
run: | | ||
npm ci --legacy-peer-deps | ||
bash scripts/run-tests.sh | ||
dgraph-js-http-publish-npm: | ||
needs: [dgraph-js-http-tests] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout dgraph-js-http repo | ||
uses: actions/checkout@v3 | ||
- name: Setup node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Build dgraph-js-http package | ||
run: npm ci --legacy-peer-deps | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_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
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