From b4806e01a1c16da32faaf67f8da021c8136d7274 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Sat, 28 Sep 2019 21:01:39 +0100 Subject: [PATCH] converted main.workflow to Actions V2 yml files (#1018) * converted main.workflow to Actions V2 yml files * dump github context * publish if release is created --- .github/main.workflow | 41 -------------------------------------- .github/workflows/push.yml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 41 deletions(-) delete mode 100644 .github/main.workflow create mode 100644 .github/workflows/push.yml diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 0118335e7..000000000 --- a/.github/main.workflow +++ /dev/null @@ -1,41 +0,0 @@ -workflow "build, test and publish on release" { - on = "push" - resolves = "publish" -} - -# install with yarn -action "install" { - uses = "actions/npm@1.0.0" - runs = "yarn" - args = "install" -} - -# build with yarn -action "build" { - needs = "install" - uses = "actions/npm@1.0.0" - runs = "yarn" - args = "build" -} - -# test with yarn -action "test" { - needs = "build" - uses = "./.github/node-chrome" - runs = "yarn" - args = "execution-tests" -} - -# filter for a new tag -action "check for new tag" { - needs = "test" - uses = "actions/bin/filter@master" - args = "tag" -} - -action "publish" { - needs = "check for new tag" - uses = "actions/npm@1.0.0" - args = "publish" - secrets = ["NPM_AUTH_TOKEN"] -} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 000000000..1993ab06b --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,38 @@ +on: push +name: build, test and (only if this a release) publish +jobs: + install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + # - name: Dump GitHub context + # env: + # GITHUB_CONTEXT: ${{ toJson(github) }} + # run: echo "$GITHUB_CONTEXT" + + - name: install + uses: actions/npm@1.0.0 + with: + entrypoint: yarn + args: install + + - name: build + uses: actions/npm@1.0.0 + with: + entrypoint: yarn + args: build + + - name: test + uses: ./.github/node-chrome + with: + entrypoint: yarn + args: execution-tests + + - name: publish if release is created + if: github.event_name == 'release' && github.event.action == 'created' + uses: actions/npm@1.0.0 + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + with: + args: publish