This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
forked from Azure/communication-ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 4.44 KB
/
alpha-release.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Manual Alpha Package Release
on:
# Allows running workflow manually from the GitHub Actions tab
workflow_dispatch:
# cancel workflow when a newer version of the workflow is triggered on the same github ref
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
# Check-out repo
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Ensure node version is great enough
- name: Use Node.js v18.x
uses: actions/setup-node@v3
with:
node-version: '18.x'
# Try get node_modules from cache
- name: Restore node_modules from cache
uses: actions/cache@v3
with:
path: common/temp/pnpm-store
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
# Install dependencies
- name: Install rush
run: npm install -g @microsoft/[email protected]
- name: Install dependencies
run: rush install --max-install-attempts 3
# Get datetime
- name: Get datetime for alpha release name
id: datetime
run: |
echo "datetime=$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
# Bump alpha package versions
- name: Bump alpha package versions
run: node common/scripts/bump-alpha-versions.js ${{ steps.datetime.outputs.datetime }}
- name: Synchronize package version reported to telemetry
run: node common/scripts/sync-telemetry-package-version
# Important to check version consistency again after bumping versions.
- name: Ensure all package versions are consistent
run: rush ensure-consistent-versions
# Alpha version run latest
- name: Force build flavor to `beta`
run: node ./common/scripts/force-build-flavor.mjs beta
# Build packages
- name: Build @azure/communication-react package
run: rush build -t @azure/communication-react
# Test Packages
- name: Test @azure/communication-react package
run: rush test -t @azure/communication-react
# Retrieve new version to tag and publish release with
- name: Retrieve new version from package.json
id: version
run: |
ver=$(jq -r .version packages/communication-react/package.json)
echo version: $ver
echo "version=$ver" >> $GITHUB_OUTPUT
# Push git tags
- name: Create and push git tags
run: |
git tag ${{ steps.version.outputs.version }}
git push --tags
# Clean package.json
- name: Remove scripts, devDependencies, and beachball from package.json
run: node ./common/scripts/preparePackageJSON.js
working-directory: ./packages/communication-react
# Publish package
- name: Package alpha packages for release
run: npm pack
working-directory: ./packages/communication-react
# Deploy npm package - this is done by uploading to Azure's SDK blob storage then triggering their partner release pipeline.
# More info: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/1/Partner-Release-Pipeline
- name: Upload tarball to blob storage
uses: azure/CLI@v1
with:
inlineScript: |
az login --service-principal -u ${{ secrets.AZURESDKPARTNERDROPS_CLIENT_ID }} -p ${{ secrets.AZURESDKPARTNERDROPS_SERVICE_PRINCIPAL_KEY }} --tenant ${{ secrets.AZURESDKPARTNERDROPS_TENANT_ID }}
az extension add --name storage-preview
az storage azcopy blob upload -s "packages/communication-react/release/*" -c "drops/azure-communication-services/react/npm/${{ steps.version.outputs.version }}" --account-name azuresdkpartnerdrops
- name: Trigger alpha package release pipeline
uses: Azure/[email protected]
with:
azure-devops-project-url: 'https://dev.azure.com/azure-sdk/internal'
azure-pipeline-name: 'azuresdkpartnerdrops to npm'
azure-devops-token: '${{ secrets.AZURE_SDK_RELEASE_PIPELINE_DEVOPS_TOKEN }}'
azure-pipeline-variables: '{"accessLevel": "public", "BlobPath": "azure-communication-services/react/npm/${{ steps.version.outputs.version }}", "registry": "https://registry.npmjs.org/", "skipDiff": "False", "tag": "dev"}'
- name: Check if npm package published successfully
run: node common/scripts/poll-npm-package-published.mjs ${{ steps.version.outputs.version }}