-
Notifications
You must be signed in to change notification settings - Fork 22
52 lines (39 loc) · 1.2 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Scratch Workflow
on:
pull_request:
branches: [ "master" ]
jobs:
build:
permissions:
id-token: write # This is required for requesting the JWT
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x] # we should pull this from a common place
steps:
- uses: actions/checkout@v3
- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: 'jq .version package.json -r'
- name: Check existing beta releases
uses: cardinalby/git-get-release-action@v1
id: released
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag: "v${{ steps.version.outputs.value }}"
- name: Block if found
if: "${{ steps.released.outputs.id }}"
run: |
echo "This version has already been release, update project version in package.json to produce beta package."
exit 1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
npm install
npm run build