Skip to content

Commit 6653aed

Browse files
author
Chris Wiechmann
committed
Github workflows for Elasticsearch
1 parent a2d14ed commit 6653aed

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# The name of the plugin to appear in the actions and badge!
2+
name: Elasticsearch Release
3+
4+
on:
5+
release:
6+
types:
7+
- published
8+
tags:
9+
# If this tag is pushed, a release is created
10+
- '*plugin-fn-elasticsearch*'
11+
12+
jobs:
13+
build:
14+
# This is a required check, as the on:release can't be filtered on given tags
15+
if: contains(github.ref, 'TAG_USED_TO_RELEASE')
16+
env:
17+
# This must be aligned with the folder-name of you plugin
18+
workingDirectory: 'api-builder-plugin-fn-elasticsearch'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v1
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: 12
25+
- name: Run npm tests
26+
working-directory: ${{env.workingDirectory}}
27+
run: |
28+
npm ci
29+
npm test
30+
31+
publish-gpr:
32+
env:
33+
# This must be aligned with the folder-name of you plugin
34+
workingDirectory: 'api-builder-plugin-fn-elasticsearch'
35+
CI: true
36+
needs: build
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v1
40+
- uses: actions/setup-node@v1
41+
with:
42+
node-version: 12
43+
registry-url: https://npm.pkg.github.com/
44+
scope: '@Axway-API-Builder-Ext'
45+
- name: Publish to GitHub package repo
46+
working-directory: ${{env.workingDirectory}}
47+
env:
48+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
49+
run: |
50+
npm ci
51+
npm publish
52+
53+
publish-npm:
54+
env:
55+
# This must be aligned with the folder-name of you plugin
56+
workingDirectory: 'api-builder-plugin-fn-elasticsearch'
57+
CI: true
58+
needs: [build, publish-gpr]
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v1
62+
- uses: actions/setup-node@v1
63+
with:
64+
node-version: 12
65+
registry-url: https://registry.npmjs.org/
66+
- name: Publish to NPM package repo
67+
working-directory: ${{env.workingDirectory}}
68+
env:
69+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
70+
run: |
71+
npm ci
72+
echo "//registry.npmjs.org/:_authToken=${{ secrets.npm_token }}" > ~/.npmrc
73+
npm publish --access public
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# The name of the workflow node to appear in the actions and badge!
2+
name: Elasticsearch Tests
3+
4+
on:
5+
push:
6+
paths:
7+
# This must be aligned with the folder-name of you plugin
8+
- 'api-builder-plugin-fn-elasticsearch/**'
9+
- '.github/workflows/**'
10+
pull_request:
11+
paths:
12+
# This must be aligned with the folder-name of you plugin
13+
- 'api-builder-plugin-fn-elasticsearch/**'
14+
- '.github/workflows/**'
15+
16+
jobs:
17+
build:
18+
env:
19+
# This must be aligned with the folder-name of you plugin
20+
workingDirectory: 'api-builder-plugin-fn-elasticsearch'
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
node-version: [8.x, 10.x, 12.x]
25+
steps:
26+
# - name: Debug
27+
# uses: hmarr/debug-action@v1.0.0
28+
- uses: actions/checkout@v1
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
- name: npm install, build, and test
34+
working-directory: ${{env.workingDirectory}}
35+
env:
36+
CI: true
37+
run: |
38+
npm ci
39+
npm run build --if-present
40+
npm test

0 commit comments

Comments
 (0)