From 39d5362fc41bac4d2a75a9e053a22241954b49a7 Mon Sep 17 00:00:00 2001 From: Jordan Anastassiades Date: Fri, 4 Aug 2023 17:11:27 +0200 Subject: [PATCH] Prepare to NPM and GPR publish --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..644aed1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org/ + - run: npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + publish-gpr: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://npm.pkg.github.com + scope: "@mist3r-robot" + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/package.json b/package.json index 18e0636..075ee24 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@Mist3r-Robot/SuppressCache", + "name": "@mist3r-robot/suppresscache", "version": "0.1.0", "description": "Randomly generate a string to clear the cache of CloudFlare or other CDN.", "main": "src/index.js",