From 34912f11da15bd9a10ad9a301230e9c8ea495d0a Mon Sep 17 00:00:00 2001 From: Ovidiu Popa Date: Tue, 5 Dec 2023 13:57:24 +0200 Subject: [PATCH] feat: Expose spinnaker/kayenta to plugin system --- .github/workflows/ci-branch.yml | 73 ++++++++++++++++++++++++++ .github/workflows/publish_lib_test.yml | 26 +++++++++ src/index.ts | 1 + 3 files changed, 100 insertions(+) create mode 100644 .github/workflows/ci-branch.yml create mode 100644 .github/workflows/publish_lib_test.yml diff --git a/.github/workflows/ci-branch.yml b/.github/workflows/ci-branch.yml new file mode 100644 index 00000000..cfa2fae7 --- /dev/null +++ b/.github/workflows/ci-branch.yml @@ -0,0 +1,73 @@ +name: Feature Branch Build + +on: + push: + branches: + - bump-version-plugin-system + +env: + NODE_VERSION: 12.16.0 + +jobs: + ci: + # Meta-job that depends on the other job statuses. Branch protection then checks this job status. + name: Kayenta CI + if: startsWith(github.repository, 'spinnaker/') + needs: [test, build] + runs-on: ubuntu-latest + steps: + - run: echo test, build successful + + test: + name: Unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + run: yarn --frozen-lockfile + + - name: Unit Tests + run: yarn test + + build: + name: Production Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Get yarn cache + id: yarn-cache + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + with: + path: ${{ steps.yarn-cache.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install Dependencies + run: yarn --frozen-lockfile + + - name: Yarn Build + run: yarn build diff --git a/.github/workflows/publish_lib_test.yml b/.github/workflows/publish_lib_test.yml new file mode 100644 index 00000000..56bf7681 --- /dev/null +++ b/.github/workflows/publish_lib_test.yml @@ -0,0 +1,26 @@ +name: Publish to NPM + +on: + push: + branches: + - 'bump-version-plugin-system' + paths: + - 'package.json' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js 12.16.0 + uses: actions/setup-node@v1 + with: + node-version: 12.16.0 + - name: publish + run: | + npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN + build_scripts/publish_github_actions.sh + env: + CI: true + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/src/index.ts b/src/index.ts index b9b06c4c..305f0e33 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1 +1,2 @@ export * from './stub'; +export * from './kayenta';