-
Notifications
You must be signed in to change notification settings - Fork 39
77 lines (73 loc) · 2 KB
/
main.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: "Main"
on:
workflow_dispatch:
inputs:
bump:
description: "Bump type, it must be: patch | minor | major"
required: true
pull_request:
push:
branches:
- "master"
- "v[0-9]+.[0-9]+.[0-9]+"
paths-ignore:
- "README.md"
env:
BUMP_TYPE: ${{ github.event.inputs.bump }}
jobs:
unit-test:
runs-on: ubuntu-latest
name: Unit tests
steps:
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20"
- run: yarn
- run: yarn build
- run: yarn test
- run: yarn lint
- run: yarn server-mock:check-types
working-directory: packages/admin-ui
env:
INFURA_MAINNET_KEY: ${{ secrets.INFURA_MAINNET_KEY }}
# integration-test:
# runs-on: ubuntu-latest
# name: In app integration tests
# steps:
# - uses: actions/checkout@v4
# - name: Enable Corepack
# run: corepack enable
# - name: Setup node
# uses: actions/setup-node@v4
# with:
# node-version: "20"
# cache: "yarn"
# - run: yarn # Caching only saves 30s
# - run: yarn build
# - run: yarn test:int
release:
name: Release
runs-on: ubuntu-latest
needs: [unit-test]
if: github.event_name == 'workflow_dispatch'
steps:
- name: Verify input
run: |
[[ "$BUMP_TYPE" == "patch" ]] || [[ "$BUMP_TYPE" == "minor" ]] || \
[[ "$BUMP_TYPE" == "major" ]] || { echo "Wrong input, it must be: patch | minor | major"; exit 1;}
- uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
- name: Publish
run: npx @dappnode/dappnodesdk publish ${BUMP_TYPE} --dappnode_team_preset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}