diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..e26f7e2 --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,33 @@ +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.npmrc b/.npmrc index 30c1548..919e700 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,3 @@ -registry=https://npm.pkg.github.com/hmhard -//npm.pkg.github.com/:_authToken=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 \ No newline at end of file +//npm.pkg.github.com/:_authToken=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 +@hmhard:registry=https://npm.pkg.github.com + diff --git a/package.json b/package.json index 3e36027..de02bb0 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,11 @@ }, "repository": { "type": "git", - "url": "/~https://github.com/hmhard/amharic-digital-clock" + "url": "/~https://github.com/hmhard/amharic-digital-clock.git" }, "publishConfig": { - "registry": "https://npm.pkg.github.com/hmhard", + "registry": "https://npm.pkg.github.com", + "@hmhard:registry": "https://npm.pkg.github.com", "access": "public" }, "dependencies": {