Skip to content

Commit

Permalink
Move package to its own job and remove gitversion from build
Browse files Browse the repository at this point in the history
  • Loading branch information
asbjornu committed Mar 20, 2021
1 parent 2c0b298 commit a5b6354
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,7 @@ name: build
on: [push, pull_request]

jobs:
gitversion:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.gitversion.outputs.fullSemVer }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- uses: gittools/actions/gitversion/[email protected]
id: gitversion
with:
useConfigFile: true
configFilePath: .github/gitversion.yml

build:
needs: gitversion
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
Expand All @@ -35,8 +17,6 @@ jobs:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
- name: npm version
run: npm version --no-git-tag-version ${{ needs.gitversion.outputs.version }}
- run: npm install
- run: npm run build
- uses: actions/upload-artifact@v2
Expand All @@ -47,8 +27,20 @@ jobs:
uses: GabrielBB/[email protected]
with:
run: npm test

package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
cache-name: cache-npm
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
- run: npm install
- name: vsce package
if: matrix.os != 'windows-latest'
run: $(npm bin)/vsce package
- uses: actions/upload-artifact@v2
with:
Expand Down

0 comments on commit a5b6354

Please sign in to comment.