From e06ae29fa1f3e309964f4f5b9f66a425878a75e7 Mon Sep 17 00:00:00 2001 From: EvolutionX Date: Wed, 29 Jun 2022 11:32:25 +0530 Subject: [PATCH] ci: update workflows --- .github/workflows/auto-deprecate.yml | 28 ++++++++++++++++++++++ .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++ package.json | 4 ++++ 3 files changed, 67 insertions(+) create mode 100644 .github/workflows/auto-deprecate.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/auto-deprecate.yml b/.github/workflows/auto-deprecate.yml new file mode 100644 index 0000000..cbbc92f --- /dev/null +++ b/.github/workflows/auto-deprecate.yml @@ -0,0 +1,28 @@ +name: NPM Auto Deprecate + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +jobs: + auto-deprecate: + name: NPM Auto Deprecate + runs-on: ubuntu-latest + + steps: + - name: Checkout Project + uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 + + - name: Use 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: Deprecate versions + run: npm deprecate @sern/cli@dev + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c1ba689 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + Publish: + name: Publishing + 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 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index a6cf762..786f27f 100644 --- a/package.json +++ b/package.json @@ -52,5 +52,9 @@ "commitizen": { "path": "./node_modules/cz-conventional-changelog" } + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "access": "public" } }