Skip to content

Commit ebee230

Browse files
authored
Merge branch 'next/fluentui' into merge/main-to-next
2 parents 66f6adf + 840b6b6 commit ebee230

File tree

6 files changed

+96
-6
lines changed

6 files changed

+96
-6
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Create Preview release
5+
on:
6+
push:
7+
tags: ['v3.*-preview.*']
8+
9+
jobs:
10+
version:
11+
runs-on: ubuntu-latest
12+
13+
outputs:
14+
latest-version: ${{steps.latest-version.outputs.version}}
15+
package-version: ${{steps.package-version.outputs.current-version}}
16+
17+
strategy:
18+
matrix:
19+
node-version: [16.x]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
registry-url: 'https://registry.npmjs.org'
29+
30+
- name: Get latest version from npm
31+
id: latest-version
32+
run: echo ::set-output name=version::$(npm show @microsoft/mgt version)
33+
34+
- name: Get current package version
35+
id: package-version
36+
uses: martinbeentjes/npm-get-version-action@master
37+
38+
release:
39+
runs-on: ubuntu-latest
40+
needs: version
41+
if: needs.version.outputs.latest-version != needs.version.outputs.package-version
42+
strategy:
43+
matrix:
44+
node-version: [16.x]
45+
46+
environment:
47+
name: release
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- name: Use Node.js ${{ matrix.node-version }}
53+
uses: actions/setup-node@v1
54+
with:
55+
node-version: ${{ matrix.node-version }}
56+
registry-url: 'https://registry.npmjs.org'
57+
58+
- name: Install Dependencies
59+
run: |
60+
npm install -g yarn lerna
61+
yarn
62+
63+
- name: Update package version
64+
run: node scripts/setVersion.js
65+
66+
- name: Build 🛠
67+
run: yarn build
68+
69+
- name: Publish npm packages
70+
run: lerna exec --scope @microsoft/* -- "npm publish --access=public"
71+
env:
72+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
74+
- name: Attach mgt-spfx solution to GitHub release
75+
run: node scripts/uploadSpfxSolution.js ${{secrets.GITHUB_TOKEN}} ${{needs.version.outputs.package-version}}
76+
77+
- name: ReleaseNotes
78+
uses: anton-yurchenko/[email protected]
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
DRAFT_RELEASE: 'true'
82+
PRE_RELEASE: 'true'
83+
CHANGELOG_FILE: 'CHANGELOG.md'
84+
ALLOW_EMPTY_CHANGELOG: 'true'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "root",
33
"private": true,
4-
"version": "3.0.0",
4+
"version": "3.0.0-preview.1",
55
"workspaces": {
66
"packages": [
77
"packages/*",

packages/mgt-element/src/utils/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// THIS FILE IS AUTO GENERATED
99
// ANY CHANGES WILL BE LOST DURING BUILD
1010

11-
export const PACKAGE_VERSION = '3.0.0';
11+
export const PACKAGE_VERSION = '3.0.0-preview.1';

packages/mgt-react/scripts/generate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ const tags = new Set([
1818
'teams-channel-picker',
1919
'todo',
2020
'file',
21-
'file-list'
21+
'file-list',
22+
'picker',
23+
'theme-toggle'
2224
]);
2325

2426
let output = '';

packages/mgt-react/src/generated/react.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export type FileListProps = {
7070
export type GetProps = {
7171
resource?: string;
7272
scopes?: string[];
73-
version?: string;
7473
type?: ResponseType;
7574
maxPages?: number;
7675
pollingRate?: number;
@@ -107,7 +106,6 @@ export type PeopleProps = {
107106
showPresence?: boolean;
108107
personCardInteraction?: PersonCardInteraction;
109108
resource?: string;
110-
version?: string;
111109
scopes?: string[];
112110
fallbackDetails?: IDynamicPerson[];
113111
templateContext?: TemplateContext;

scripts/setVersion.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ const updateMgtDependencyVersion = (packages, version) => {
4040
};
4141

4242
const updateSpfxSolutionVersion = (solutions, version) => {
43+
const isPreview = version.indexOf('-preview') > 0;
44+
if (isPreview) {
45+
version = version.replace(/-preview\./, '.');
46+
}
4347
for (let solution of solutions) {
4448
console.log(`updating spfx solution ${solution} with version ${version}`);
4549
const data = fs.readFileSync(solution, 'utf8');
4650

47-
var result = data.replace(/"version": "(.*)"/g, `"version": "${version}.0"`);
51+
const result = isPreview
52+
? data.replace(/"version": "(.*)"/g, `"version": "${version}"`)
53+
: data.replace(/"version": "(.*)"/g, `"version": "${version}.0"`);
4854

4955
fs.writeFileSync(solution, result, 'utf8');
5056
}

0 commit comments

Comments
 (0)