From cd21dced2f34ec51b64a0977cdbf82205f617a0e Mon Sep 17 00:00:00 2001 From: Justin Debbink Date: Thu, 19 Sep 2024 08:08:19 -0500 Subject: [PATCH] Publish --- .github/workflows/build-test.yml | 20 ++++++----- .gitlab-ci.yml | 62 -------------------------------- 2 files changed, 11 insertions(+), 71 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 43d3804..53fce49 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -2,8 +2,10 @@ name: Build and Test on: push: - # branches: - # - master + branches: + - master + tags: + - 'v*' pull_request: branches: - master @@ -14,24 +16,24 @@ permissions: jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7 - + - name: Checkout + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7 - name: Setup Node uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # 4.0.3 with: node-version-file: .nvmrc cache: 'yarn' - - name: Install dependencies run: yarn install - - name: Lint run: yarn lint - - name: Build run: yarn build - - name: Test run: yarn test + - name: Publish + if: startsWith(github.ref, 'refs/tags/v') + run: | + echo '//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}'>.npmrc + npm publish diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 81117f7..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -image: docker.gamechanger.io/node:18.16.0-alpine3.16 - -stages: - - setup - - test - - deploy - -install: - stage: setup - script: - - yarn install - interruptible: true - artifacts: - name: 'node-modules-$CI_COMMIT_REF_NAME' - expire_in: 1 hour - paths: - - node_modules/ - only: - refs: - - branches - - tags - -lint: - stage: test - script: - - yarn lint - interruptible: true - only: - refs: - - branches - - tags - -test: - stage: test - script: - - yarn test - only: - refs: - - branches - - tags - -compile: - stage: test - script: - - yarn build - artifacts: - name: 'lib-$CI_COMMIT_REF_NAME' - expire_in: 1 hour - paths: - - lib/ - only: - refs: - - branches - - tags - -publish: - stage: deploy - script: - - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc - - npm publish - only: - - tags