From 81eabff53e56fe8bc5c8735d4903c5971b211ff9 Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Wed, 22 Jun 2022 12:58:06 +0530 Subject: [PATCH] ci: finally done --- .github/workflows/continuous-delivery.yml | 19 +++++++------ .github/workflows/test.yml | 34 ----------------------- 2 files changed, 10 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index a0053ac..7fff20e 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -3,10 +3,15 @@ name: Continuous Delivery on: release: types: [published] + workflow_dispatch: + inputs: + tag: + description: The tag of the package + required: true jobs: - Build: - name: Building + Publish: + name: Publishing runs-on: ubuntu-latest steps: @@ -28,13 +33,9 @@ jobs: - name: Test Sern run: sern - Publish: - name: Publishing to npm - runs-on: ubuntu-latest - needs: [Build] - steps: - name: Publish to npm - run: npm publish + run: | + TAG=$([[ ${{ github.event_name }} == 'release' ]] && echo 'latest' || echo '${{ github.event.inputs.tag }}') + npm publish --tag ${TAG} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 662c0ee..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Continuous Delivery - -on: - workflow_dispatch: - -jobs: - Publish: - name: Building - runs-on: ubuntu-latest - - steps: - - name: Check out Git repository - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 - - - name: Set up Node.js - uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # tag=v3 - with: - node-version: 17 - registry-url: 'https://registry.npmjs.org' - - - name: Install Node.js dependencies - run: npm i - - - name: Link Project - run: npm link - - - name: Test Sern - run: sern - - - name: Publish to npm - run: npm publish --dry-run - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} -