From 6a7e668706c491e6af0e3dca6b269d66ab759d36 Mon Sep 17 00:00:00 2001 From: Laura Date: Sat, 8 Aug 2020 21:53:26 -0300 Subject: [PATCH 1/4] Add npm publish workflow --- .github/workflows/npm-publish.yaml | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/npm-publish.yaml diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml new file mode 100644 index 0000000..1f4d0ee --- /dev/null +++ b/.github/workflows/npm-publish.yaml @@ -0,0 +1,36 @@ +name: publish + +on: + release: + types: [published] + +jobs: + npm-publish: + name: npm-publish + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@master + + - name: Set up Node.js + uses: actions/setup-node@master + with: + node-version: 10.0.0 + + - name: Change directory to package + run: cd package + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Publish to npm + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + + - if: steps.publish.type != 'none' + run: | + echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" From 102fb362fd0c16abb441ff9c2e918c044d7b4bd0 Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 12 Aug 2020 10:54:23 -0300 Subject: [PATCH 2/4] Add workflow to bump package version on push to master --- .github/workflows/bump-version.yaml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/bump-version.yaml diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml new file mode 100644 index 0000000..35e24a3 --- /dev/null +++ b/.github/workflows/bump-version.yaml @@ -0,0 +1,35 @@ +name: "Bump Version" + +on: + push: + branches: + - "master" + +jobs: + bump-version: + name: "Bump Version on master" + runs-on: ubuntu-latest + + steps: + - name: "Checkout source code" + uses: "actions/checkout@v2" + with: + ref: ${{ github.ref }} + + - name: "cat package.json" + run: cat ./package.json + + - name: "Setup Node.js" + uses: "actions/setup-node@v1" + with: + node-version: 12 + + - name: "Automated Version Bump" + uses: "phips28/gh-action-bump-version@master" + with: + tag-prefix: '' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "cat package.json" + run: cat ./package.json From 4422f3f0e969c8e7b9632f3f104155d886471a2f Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 12 Aug 2020 11:10:00 -0300 Subject: [PATCH 3/4] Fix yml indentation --- .github/workflows/bump-version.yaml | 2 +- .github/workflows/npm-publish.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml index 35e24a3..5765f27 100644 --- a/.github/workflows/bump-version.yaml +++ b/.github/workflows/bump-version.yaml @@ -10,7 +10,7 @@ jobs: name: "Bump Version on master" runs-on: ubuntu-latest - steps: + steps: - name: "Checkout source code" uses: "actions/checkout@v2" with: diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index 1f4d0ee..b123602 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -18,13 +18,13 @@ jobs: node-version: 10.0.0 - name: Change directory to package - run: cd package + run: cd package - name: Install dependencies - run: yarn install + run: yarn install - name: Build - run: yarn build + run: yarn build - name: Publish to npm uses: JS-DevTools/npm-publish@v1 @@ -32,5 +32,5 @@ jobs: token: ${{ secrets.NPM_TOKEN }} - if: steps.publish.type != 'none' - run: | - echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" + run: | + echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" From 5cba6f5457fc47659a261899a3f63567c63bc74d Mon Sep 17 00:00:00 2001 From: Laura Date: Wed, 12 Aug 2020 11:17:47 -0300 Subject: [PATCH 4/4] Fix npm-publish.yml format --- .github/workflows/npm-publish.yaml | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index b123602..670dac7 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -9,28 +9,28 @@ jobs: name: npm-publish runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@master + - name: Checkout repository + uses: actions/checkout@master - - name: Set up Node.js - uses: actions/setup-node@master - with: - node-version: 10.0.0 + - name: Set up Node.js + uses: actions/setup-node@master + with: + node-version: 10.0.0 - - name: Change directory to package - run: cd package + - name: Change directory to package + run: cd package - - name: Install dependencies - run: yarn install + - name: Install dependencies + run: yarn install - - name: Build - run: yarn build + - name: Build + run: yarn build - - name: Publish to npm - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} + - name: Publish to npm + uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} - - if: steps.publish.type != 'none' - run: | - echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" + - if: steps.publish.type != 'none' + run: | + echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"