From 8426bf89fd7977525d253fa64128fa64ee870a80 Mon Sep 17 00:00:00 2001 From: Aneesh Relan Date: Tue, 5 Oct 2021 23:10:58 +0530 Subject: [PATCH 1/2] 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 000000000..ff37a530a --- /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 From b3bf0f39900ea50c0e5a0e18779e71af868fe7d6 Mon Sep 17 00:00:00 2001 From: Aneesh Relan Date: Tue, 5 Oct 2021 23:22:25 +0530 Subject: [PATCH 2/2] fix: remove dry run --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff37a530a..7848e6ee9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,13 +16,13 @@ jobs: registry-url: 'https://registry.npmjs.org' - run: npm install # Publish to npm - - run: npm publish --dry-run + - run: npm publish 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 + - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file