From 37681c429912087706c53c5866f3461737965f4c Mon Sep 17 00:00:00 2001 From: Darsh Date: Sat, 3 Oct 2020 00:49:06 +0530 Subject: [PATCH] test and publish config --- .github/workflows/testandpublish.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/testandpublish.yml diff --git a/.github/workflows/testandpublish.yml b/.github/workflows/testandpublish.yml new file mode 100644 index 0000000..04e5c61 --- /dev/null +++ b/.github/workflows/testandpublish.yml @@ -0,0 +1,38 @@ +name: Test, Publish, & Release +on: [push] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [13.x, 14.x] + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - run: yarn test + publish: + needs: test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@v1 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + - run: yarn + - run: yarn publish + env: + NODE_AUTH_TOKEN: ${{ secrets.npm_token }} + create-release: + needs: test + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@master + - uses: Roang-zero1/github-create-release-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file