Skip to content

Commit a2a58e4

Browse files
authored
Merge pull request #1052 from IgniteUI/sstoychev/github-actions-pipe
feat(cd): adding github pipeline for cd
2 parents b5fd7bd + f477d45 commit a2a58e4

2 files changed

Lines changed: 118 additions & 6 deletions

File tree

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: IgniteUI React Examples CD
2+
permissions:
3+
contents: write
4+
5+
on:
6+
push:
7+
branches:
8+
- vnext
9+
- master
10+
workflow_dispatch:
11+
inputs:
12+
branch:
13+
description: 'Input a branch name (e.g., vnext)'
14+
required: true
15+
isVerbose:
16+
description: 'Get verbose output from steps - where configurable'
17+
type: boolean
18+
default: false
19+
20+
env:
21+
BRANCH_REF: ${{ github.event.inputs.branch && format('refs/heads/{0}', github.event.inputs.branch) || github.ref }}
22+
23+
jobs:
24+
BuildSamples:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
ref: ${{ env.BRANCH_REF }}
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Install Node
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '22.x'
38+
cache: 'npm'
39+
cache-dependency-path: browser/package-lock.json
40+
41+
- name: Register licensed npm registry in .npmrc
42+
working-directory: browser
43+
run: |
44+
npm config -L project set @infragistics:registry=https://packages.infragistics.com/npm/js-licensed/
45+
npm config -L project set //packages.infragistics.com/npm/js-licensed/:_authToken=${{ secrets.INFRAGISTICS_NPM_TOKEN }}
46+
47+
- name: Replace references to IG trial packages with licensed ones in package.json
48+
working-directory: browser
49+
shell: pwsh
50+
run: |
51+
$packageJson = Get-Content -Raw ./package.json | ConvertFrom-Json
52+
$properties = $packageJson.dependencies.PSObject.Properties `
53+
| where-object { $_.Name.StartsWith("igniteui-react") -or $_.Name.StartsWith("igniteui-dockmanager") }
54+
55+
foreach( $property in $properties )
56+
{
57+
$oldName = $property.Name;
58+
$newName = "@infragistics/" + $oldName
59+
60+
# remember the current value of the old property
61+
$value = $property.Value;
62+
63+
# remove reference to the trial package reference
64+
$packageJson.dependencies.psobject.Properties.Remove($oldName);
65+
66+
# add reference to the licensed package reference
67+
$packageJson.dependencies | Add-Member -NotePropertyName $newName -NotePropertyValue $value;
68+
}
69+
70+
ConvertTo-Json -InputObject $packageJson | Set-Content -Path ./package.json
71+
72+
- name: npm install
73+
working-directory: browser
74+
run: npm install
75+
76+
- name: Replace references to IG trial packages with licensed ones in TSX files
77+
shell: pwsh
78+
run: |
79+
Get-ChildItem -Include "*.tsx","*.ts" -Recurse | `
80+
ForEach { (Get-Content $_.PSPath | ForEach { ($_ -replace '(from|import)\s?[''"]( igniteui-(react|dockmanager).*)[''"]', '$1 "@infragistics/$2"') }) | `
81+
Set-Content $_.PSPath }
82+
83+
- name: npm run build
84+
working-directory: browser
85+
run: npm run build
86+
87+
- name: Package samples browser
88+
run: zip -r ${{ github.workspace }}/react-samples.zip browser/build/.
89+
90+
- name: Publish pipeline artifact
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: react-samples-artifact
94+
path: react-samples.zip
95+
96+
- name: Trigger Deploy Workflow in IgniteUI Actions
97+
uses: actions/github-script@v8
98+
with:
99+
github-token: ${{ secrets.CLASSIC_PAT_GITHUB }}
100+
script: |
101+
await github.rest.repos.createDispatchEvent({
102+
owner: 'IgniteUI',
103+
repo: 'igniteui-actions',
104+
event_type: 'igniteui-samples-cd',
105+
client_payload: {
106+
calling_branch: "${{ env.BRANCH_REF }}",
107+
repository: "${{ github.repository }}",
108+
run_id: "${{ github.run_id }}",
109+
artifact_name: "react-samples-artifact",
110+
base_href: "react-demos",
111+
submodule_dir: "react-demos",
112+
ref: "${{ github.ref }}",
113+
sha: "${{ github.sha }}",
114+
branch: '${{ github.ref_name }}',
115+
}
116+
});
117+

azure-pipelines/build-pipeline.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
trigger:
2-
branches:
3-
include:
4-
- vnext
5-
- master
6-
1+
trigger: none
72
pr: none
83

94
parameters:

0 commit comments

Comments
 (0)