Skip to content

Commit ff518de

Browse files
merge
1 parent 5f84c18 commit ff518de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3539
-1918
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# @global-owner1 and @global-owner2 will be requested for
1010
# review when someone opens a pull request.
1111

12-
* @calebmshafer @evelynpreslar-bentley @aruniverse @ben-polinsky @anmolshres98 @MichaelSwigerAtBentley
12+
* @aruniverse @ben-polinsky @anmolshres98 @MichaelSwigerAtBentley

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ jobs:
2828
git config --local user.name imodeljs-admin
2929
3030
- name: Setup node
31-
uses: actions/setup-node@v2
31+
uses: actions/setup-node@v4
3232
with:
33-
node-version: "18.12.0"
33+
node-version: 20.x
3434

3535
- name: Setup pnpm
36-
run: corepack enable
36+
uses: pnpm/action-setup@v4
3737

3838
- name: Install packages
3939
run: pnpm install

.github/workflows/codeql-analysis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout branch
23-
uses: actions/checkout@v3
23+
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
2626

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create GitHub Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '@itwin/*_v[0-9]+.[0-9]+.[0-9]+'
7+
workflow_dispatch:
8+
9+
jobs:
10+
create-release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout tag
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.ref }} # checkouts the branch that triggered the workflow
18+
fetch-depth: 0
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.x
24+
25+
- name: Install pnpm
26+
uses: pnpm/action-setup@v4
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Configure git
32+
run: |
33+
git config --local user.email imodeljs-admin@users.noreply.github.com
34+
git config --local user.name imodeljs-admin
35+
36+
- name: Create GitHub release
37+
run: |
38+
echo "Creating GitHub release for tag ${{ github.ref }}"
39+
bash .github/workflows/scripts/create-release.sh ${{ github.ref }}
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.IMJS_ADMIN_GH_TOKEN }}
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Workflow that will create a GitHub release a when a new release tag is pushed
2-
3-
name: Create Release
1+
name: Publish Packages to npm
42

53
on: workflow_dispatch
64

@@ -11,26 +9,26 @@ jobs:
119
name: Release packages
1210
steps:
1311
- name: Checkout
14-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1513
with:
1614
token: ${{ secrets.IMJS_ADMIN_GH_TOKEN }}
1715

18-
- name: Use Node.js 18
19-
uses: actions/setup-node@v3
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
2018
with:
21-
node-version: 18.16.x
19+
node-version: 20.x
2220
registry-url: https://registry.npmjs.org/
2321

24-
- name: Setup pnpm
25-
run: corepack enable
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v4
2624

2725
- name: Install dependencies
2826
run: pnpm install
2927

3028
- name: Build, Lint, Test
3129
run: pnpm lage build lint cover
3230

33-
- name: Publish packages
31+
- name: Publish packages and create git tags
3432
run: |
3533
git config --local user.email imodeljs-admin@users.noreply.github.com
3634
git config --local user.name imodeljs-admin
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]; then
4+
echo "No refName was supplied"
5+
exit 1
6+
fi
7+
8+
refName=$1
9+
echo "Ref name passed in: $refName"
10+
11+
tagName=$(echo $refName | sed 's/refs\/tags\///')
12+
echo "Tag name was parsed as: $tagName"
13+
packageName=$(echo $tagName | sed 's/_v.*//')
14+
echo "Package name was parsed as: $packageName"
15+
packageVersion=$(echo $tagName | sed 's/.*_v//')
16+
echo "Package version was parsed as: $packageVersion"
17+
18+
# The packageDirectory variable is determined by searching the ./packages directory for a subdirectory
19+
# that contains a package.json file with a name matching the parsed packageName.
20+
# determine package directory so that we can zip it up and also find the changelog
21+
packageDirectory=$(find ./packages -maxdepth 1 -type d | while read dir; do
22+
if [ -f "$dir/package.json" ]; then
23+
packageNameInJson=$(jq -r '.name' "$dir/package.json")
24+
if [ "$packageNameInJson" == "$packageName" ]; then
25+
echo "$dir"
26+
break
27+
fi
28+
fi
29+
done)
30+
31+
if [ -z "$packageDirectory" ]; then
32+
echo "No package directory found for package name: $packageName"
33+
exit 1
34+
else
35+
echo "Package directory was determined as: $packageDirectory"
36+
fi
37+
38+
cd $packageDirectory
39+
40+
changelogMd="CHANGELOG.md"
41+
if [ ! -f "$changelogMd" ]; then
42+
echo "Changelog file not found: $changelogMd"
43+
exit 1
44+
fi
45+
46+
# build the package and create consumable to release
47+
pnpm build
48+
49+
# Extract the changelog text
50+
releaseNoteText=$(awk -v version="$packageVersion" '$0 ~ version {flag=1; print; next} /^## /{flag=0} flag' "$changelogMd")
51+
echo "Release note text was extracted as: $releaseNoteText"
52+
53+
# remove the @itwin/ or @bentley/ scope from the tag name to create the zip file name since they have special characters
54+
zipFileName=$(echo "$tagName" | sed 's/@itwin\///; s/@bentley\///')
55+
echo "Zip file name was parsed as: $zipFileName"
56+
57+
# Zip the package deliverables - lib and dist directories
58+
zip -r "$zipFileName.zip" lib dist
59+
tar -czvf "$zipFileName.tar.gz" lib dist
60+
61+
# Create a release and upload assets
62+
gh release create "$tagName" \
63+
"$zipFileName.zip" \
64+
"$zipFileName.tar.gz" \
65+
--notes "$releaseNoteText" \
66+
--verify-tag

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dist
99

1010
# testing
1111
.nyc_output
12-
.parcel-cache
1312
junit_results.xml
1413
/**/test-results/**/*
1514
generated-docs

.pipelines/build-docs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ stages:
3333
clean: true
3434

3535
- task: NodeTool@0
36-
displayName: Use Node 18
36+
displayName: Use Node 20
3737
inputs:
38-
versionSpec: 18
38+
versionSpec: 20
3939
checkLatest: true
4040

41-
- script: corepack enable
41+
- script: npm install -g corepack && corepack enable
4242
displayName: Install pnpm
4343

4444
- script: |

.pipelines/integration-test.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ variables:
1212
- group: iTwin.js non-secret config variables
1313
- group: iTwin.js Integration Test Users
1414
- group: iTwin.js Auth Client Integration tests
15+
- name: packages
16+
value: browser-authorization, electron-authorization, oidc-signin-tool
1517

1618
jobs:
17-
- job: BuildPackages
19+
- job: IntegrationTests
1820
strategy:
1921
matrix:
2022
linux:
@@ -32,9 +34,9 @@ jobs:
3234
- task: NodeTool@0
3335
displayName: Use Node 18
3436
inputs:
35-
versionSpec: 18.x
37+
versionSpec: 18.16.x
3638

37-
- script: corepack enable
39+
- script: npm install -g corepack && corepack enable
3840
displayName: Install pnpm
3941

4042
- bash: |
@@ -53,7 +55,7 @@ jobs:
5355
test_azuread_user_password: $(IMJS_TEST_AZUREAD_USER_PASSWORD)
5456
condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
5557
56-
# For debugging
58+
# For debugging
5759
- bash: |
5860
export
5961
@@ -106,13 +108,14 @@ jobs:
106108
IMJS_TEST_REGULAR_USER_PASSWORD: $(IMJS_TEST_REGULAR_USER_PASSWORD)
107109
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
108110
109-
- script: pnpm test:integration
110-
displayName: pnpm test:integration
111-
env:
112-
# Couldn't get this variable to be ingested in the steps above, but this works
113-
IMJS_TEST_AZUREAD_USER_PASSWORD: $(IMJS_TEST_AZUREAD_USER_PASSWORD)
114-
IMJS_TEST_REGULAR_USER_PASSWORD: $(IMJS_TEST_REGULAR_USER_PASSWORD)
115-
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
111+
- ${{ each package in split(variables.packages, ', ')}}:
112+
- script: pnpm --filter ${{package}} test:integration
113+
displayName: run ${{package}} tests
114+
env:
115+
# Couldn't get this variable to be ingested in the steps above, but this works
116+
IMJS_TEST_AZUREAD_USER_PASSWORD: $(IMJS_TEST_AZUREAD_USER_PASSWORD)
117+
IMJS_TEST_REGULAR_USER_PASSWORD: $(IMJS_TEST_REGULAR_USER_PASSWORD)
118+
condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
116119

117120
- task: PublishTestResults@2
118121
displayName: "Publish Integration Test Results"

change/@itwin-electron-authorization-6167fbe7-5849-43e0-a59c-adac7912c58f.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)