-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (49 loc) · 1.71 KB
/
deploy.yaml
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
name: Deploy to NPM
on:
push:
# If you add a branch here, you **MUST** create a branch rule in Github settings
branches: ['*.*.x', '*.x', 'main', 'next', 'next-major', 'beta', 'alpha']
paths:
- 'src/**'
- 'runtime/**'
workflow_dispatch: # trigger manually
inputs:
dry_run:
description: 'NPM release dry-run'
required: true
default: 'true'
jobs:
# Gihub Actions do not allow regex validation for numbers in *.*.x branch names
validate_branch_name:
runs-on: [self-hosted, ubuntu-22-04, regular]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate branch name
run: |
branch_name=$(echo $GITHUB_REF | cut -d'/' -f3)
if [[ $branch_name =~ ^[0-9]+(\.[0-9]+)?\.x$ ]] || [[ $branch_name == "main" ]] || [[ $branch_name == "next" ]] || [[ $branch_name == "next-major" ]] || [[ $branch_name == "beta" ]] || [[ $branch_name == "alpha" ]]; then
echo "Branch name is valid"
else
echo "Branch name is invalid"
exit 1
fi
code_validation:
needs: [validate_branch_name]
uses: ./.github/workflows/code-validation.yaml
unit_tests:
needs: [validate_branch_name]
uses: ./.github/workflows/unit-tests.yaml
build_fastedge_artifacts:
needs: [code_validation, unit_tests]
uses: ./.github/workflows/build-libs.yaml
secrets:
VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}
npm_release:
needs: [build_fastedge_artifacts]
uses: ./.github/workflows/release.yaml
with:
dry_run: ${{ github.event.inputs.dry_run || 'true' }}
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}