From 8426bf89fd7977525d253fa64128fa64ee870a80 Mon Sep 17 00:00:00 2001 From: Aneesh Relan Date: Tue, 5 Oct 2021 23:10:58 +0530 Subject: [PATCH] ci: add github action to publish to npm and github packages --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ff37a530 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Publish Package +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + # Publish to npm + - run: npm publish --dry-run + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: actions/setup-node@v2 + with: + registry-url: 'https://npm.pkg.github.com' + # Publish to GitHub Packages + - run: npm publish --dry-run + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file