From c0b8f6f86ae0a3b47758fb157f125411ec25596c Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 18 Nov 2019 18:28:26 +0200 Subject: [PATCH] Create release github action workflow --- .github/workflows/release.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 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..1447242e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + tags: v* + +jobs: + release: + name: Release workflow + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + registry-url: "https://registry.npmjs.org/" + + - name: Install + run: yarn --frozen-lockfile --non-interactive + + - name: Build + run: yarn build + env: + NODE_ENV: production + + - name: Test + run: yarn test + + - name: Publish latest + if: "!contains(github.ref, '-')" + run: npm publish --tag latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + + - name: Publish next + if: contains(github.ref, '-') + run: npm publish --tag next + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} + + - name: Remove next tag + if: "!contains(github.ref, '-')" + run: npm dist-tag rm thelounge next || true + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}