Skip to content

Commit

Permalink
Merge pull request #2 from tetrascience/EP-187
Browse files Browse the repository at this point in the history
EP-187: Publish to JFrog Artifactory
  • Loading branch information
aslotte authored Aug 3, 2022
2 parents c0d56a5 + 1c52359 commit 5e058cd
Show file tree
Hide file tree
Showing 8 changed files with 5,263 additions and 29 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches:
- master
- 'release/**'
pull_request:
branches:
- master
- 'release/**'

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Configure JFrog Artifactory
run: |
echo "npmRegistryServer: ${{ secrets.JFROG_ARTIFACTORY_NPM_VIRTUAL_URL }}" >> .yarnrc.yml
echo "npmAuthIdent: ${{ secrets.JFROG_ARTIFACTORY_DATA_LAKE_NPM_AUTH }}" >> .yarnrc.yml
echo "npmAlwaysAuth: true" >> .yarnrc.yml
- name: yarn install
run: yarn install --immutable

- name: yarn test
run: yarn test

- name: Upload coverage
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/lcov.info
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish

on:
push:
tags: '*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16

- name: Configure JFrog Artifactory
run: |
echo "npmRegistryServer: ${{ secrets.JFROG_ARTIFACTORY_NPM_VIRTUAL_URL }}" >> .yarnrc.yml
echo "npmAuthIdent: ${{ secrets.JFROG_ARTIFACTORY_DATA_LAKE_NPM_AUTH }}" >> .yarnrc.yml
echo "npmAlwaysAuth: true" >> .yarnrc.yml
- run: yarn install --immutable

- name: Check if Typescript
id: check_typescript
uses: andstor/file-existence-action@v1
with:
files: "tsconfig.json"

- name: yarn build
if: steps.check_typescript.outputs.files_exists == 'true'
run: yarn build

- name: yarn test
if: ${{ inputs.run_tests }}
run: yarn test

- name: match-tag-to-package-version
id: match-version
uses: geritol/match-tag-to-package-version@0.2.0
with:
TAG_PREFIX: v

- name: Configure JFrog Artifactory (Publish)
run: |
sed -i "s/npmRegistryServer: .*//g" .yarnrc.yml
echo "npmRegistryServer: ${{ secrets.JFROG_ARTIFACTORY_DATA_LAKE_URL }}" >> .yarnrc.yml
- name: Publish package
if: steps.match-version.PACKAGE_VERSION == steps.match-version.TAG_VERSION
run: yarn npm publish
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ node_modules
# Project files
.idea
.project

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.2.cjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarnPath: .yarn/releases/yarn-3.2.2.cjs
nodeLinker: node-modules
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "spleen-elasticsearch",
"name": "ts-spleen-elasticsearch",
"longName": "spleen-elasticsearch",
"description": "Convert spleen filters into Elasticsearch queries.",
"version": "1.0.0",
"version": "2.0.0",
"dependencies": {
"elv": "^2.0.0",
"spleen": "^1.3.0"
Expand All @@ -14,8 +14,8 @@
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"mocha": "^3.2.0",
"nyc": "^10.2.0"
"mocha": "^10.0.0",
"nyc": "^15.1.0"
},
"keywords": [
"conditional",
Expand All @@ -39,7 +39,6 @@
"peerDependencies": {
"spleen": ">=1.3.0"
},
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/dsfields/spleen-elasticsearch-node"
Expand All @@ -48,5 +47,6 @@
"lint": "eslint ./*",
"test": "NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --recursive ./test/unit",
"test:integration": "sh ./test/integration/services/run.sh && NODE_ENV=test nyc --reporter=lcov --reporter=text mocha ./test/integration"
}
},
"packageManager": "yarn@3.2.2"
}
Loading

0 comments on commit 5e058cd

Please sign in to comment.