Skip to content

Commit

Permalink
Refactored build steps into separate action.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcells committed Nov 22, 2020
1 parent 5aab749 commit 39ab351
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 40 deletions.
19 changes: 19 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Install dependencies and build project'
runs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install grunt-cli
run: npm install -g grunt-cli

- name: Install local dependencies
run: npm install

- name: Run CI build
run: npm run-script ci
19 changes: 1 addition & 18 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,4 @@ jobs:
node-version: [14.x]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install global dependencies
run: |
npm install -g grunt-cli
npm install -g [email protected]
- name: Install local dependencies
run: npm install

- name: Run CI build
run: npm run-script ci
- uses: ./.github/actions/build
31 changes: 9 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,17 @@ jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install global dependencies
run: |
npm install -g grunt-cli
npm install -g pkg
- uses: ./.github/actions/build

release:
runs-on: ubuntu-latest
needs: build

- name: Install local dependencies
run: npm install
steps:
- name: Install pkg dependency
run: npm install -g pkg

- name: Run CI build
run: npm run-script ci

- name: Build Release Package
run: npm run-script pkg

Expand All @@ -43,7 +30,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true
prerelease: false

Expand Down

0 comments on commit 39ab351

Please sign in to comment.