From 648dbe8f03ab1b3a41c6abf7073d0daf9aa79021 Mon Sep 17 00:00:00 2001 From: Evgenii Popov Date: Fri, 1 May 2020 05:07:01 +0300 Subject: [PATCH 1/2] Create npmpublish.yml This github action when new tag pushed to the repo will go through tests and after will do auto publish to npm (but don't forget to supply repo with npm auth token in settings -> secrets. You need secret with name npm_token and auth token from npm) --- .github/workflows/npmpublish.yml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/npmpublish.yml diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml new file mode 100644 index 0000000..0e85b16 --- /dev/null +++ b/.github/workflows/npmpublish.yml @@ -0,0 +1,51 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + meteor: [ '1.9.3', '1.10.2' ] + name: Meteor ${{ matrix.meteor }} sample + steps: + - uses: actions/checkout@v1 + - name: Setup meteor + uses: CanyLink/setup-meteor@v1.0.3 + with: + meteor-release: ${{ matrix.meteor }} + - run: meteor npm install + - run: meteor npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} From 961d6ae4fc5bd2eb1ff8aee9bcbe16ae8ceeaea9 Mon Sep 17 00:00:00 2001 From: Evgenii Popov Date: Sat, 2 May 2020 02:30:29 +0300 Subject: [PATCH 2/2] fix: incorrectly used version of env with meteor-cli --- .github/workflows/npmpublish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 0e85b16..6f62b2d 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v1 - name: Setup meteor - uses: CanyLink/setup-meteor@v1.0.3 + uses: CanyLink/setup-meteor@v1 with: meteor-release: ${{ matrix.meteor }} - run: meteor npm install