|
| 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 |
0 commit comments