-
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (65 loc) · 1.86 KB
/
build-remote.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
name: Build remote branch
run-name: "Build remote branch: ${{ inputs.repo }}#${{ inputs.branch }}"
on:
workflow_call:
inputs:
repo:
description: 'Repository'
type: string
required: true
branch:
description: 'Branch'
type: string
required: true
outputs:
artifact:
description: "Artifact name"
value: ${{ jobs.build.outputs.name }}
secrets:
RETE_QA_PUBLIC_PULL:
description: 'GitHub Personal access token'
required: true
workflow_dispatch:
inputs:
repo:
description: 'Repository'
required: true
branch:
description: 'Branch'
required: true
jobs:
build:
name: Build ${{ inputs.repo }}#${{ inputs.branch }}
runs-on: ubuntu-latest
outputs:
name: ${{ steps.package-info.outputs.name }}
steps:
- name: Info
run: |
echo "Repository: ${{ inputs.repo }}"
echo "Branch: ${{ inputs.branch }}"
- uses: actions/checkout@v3
with:
repository: ${{ inputs.repo }}
token: ${{ secrets.RETE_QA_PUBLIC_PULL }}
ref: ${{ inputs.branch }}
- name: Use Node.js
uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
- name: Run build
run: npm run build
- name: Get npm package name
id: package-info
working-directory: dist
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
SANITIZED_NAME=$(echo $PACKAGE_NAME | sed 's/[@/]/-/g')
echo "name=$SANITIZED_NAME" >> $GITHUB_OUTPUT
- name: Print package info
run: echo ${{ steps.package-info.outputs.name }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ steps.package-info.outputs.name }}
path: dist