Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit d31c003

Browse files
committed
Merge branch 'master' into fix/checkbox-disabled-color-values
2 parents a956585 + 66299b6 commit d31c003

File tree

89 files changed

+3028
-1671
lines changed

Some content is hidden

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

89 files changed

+3028
-1671
lines changed
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
name: NPM Publish
1+
name: MDC Release (Canary)
2+
3+
# This workflow creates a pre-release and publishes packages to NPM with canary
4+
# tag on every commit to master.
25

36
on:
47
push:
58
branches:
6-
- develop
9+
- master
710
paths:
811
- 'packages/**/*.ts'
912
- 'packages/**/*.scss'
1013
- '**/package*.json'
1114
- '**/.npmignore'
1215

1316
jobs:
14-
publish-npm:
17+
release-canary:
1518
runs-on: ubuntu-latest
1619
steps:
17-
- name: Checkout develop branch
18-
uses: actions/checkout@v1
19-
with:
20-
ref: develop
21-
fetch-depth: 1
20+
- name: Clone repository
21+
uses: actions/[email protected]
22+
- name: Checkout master branch
23+
# GITHUB_REF:11 gets `refs/heads/master` => `master`.
24+
# See https://github.com/actions/checkout/issues/6
25+
run: |
26+
git checkout "${GITHUB_REF:11}"
27+
git pull
2228
- name: Setup node
2329
uses: actions/setup-node@v1
2430
with:
@@ -32,13 +38,13 @@ jobs:
3238
npm run dist
3339
node scripts/cp-pkgs.js
3440
node scripts/verify-pkg-main.js
35-
- name: Create release
41+
- name: Create canary release
3642
run: |
3743
npx lerna version premajor --no-git-tag-version --no-push --preid canary.$(git rev-parse --short HEAD) --yes --exact
3844
git config --local user.email "[email protected]"
3945
git config --local user.name "GitHub Action"
4046
git commit -am "chore: Publish"
41-
- name: Publish to NPM registry
47+
- name: Publish to NPM registry with canary tag
4248
run: npx lerna publish from-package --yes --dist-tag canary
4349
env:
4450
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: MDC Release (Pull Request)
2+
3+
# This workflow creates or updates (if already exists) a pull request with new
4+
# version bump on every commit to master.
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
paths:
11+
- 'packages/**/*.ts'
12+
- 'packages/**/*.scss'
13+
- '**/package*.json'
14+
- '**/.npmignore'
15+
- '**/*.md'
16+
17+
jobs:
18+
release-pull-request:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Clone repository
22+
uses: actions/[email protected]
23+
- name: Checkout master branch
24+
# GITHUB_REF:11 gets `refs/heads/master` => `master`.
25+
# See https://github.com/actions/checkout/issues/6
26+
run: |
27+
git checkout "${GITHUB_REF:11}"
28+
git pull
29+
- name: Setup node
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: 10
33+
registry-url: https://registry.npmjs.org/
34+
- name: Install dependencies
35+
run: |
36+
npm install
37+
- name: Bump version
38+
run: |
39+
npx lerna version --conventional-commits --no-git-tag-version --no-push --yes
40+
- name: Create PR
41+
uses: peter-evans/[email protected]
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
COMMIT_MESSAGE: "chore: Release"
45+
COMMIT_AUTHOR_EMAIL: action@@users.noreply.github.com
46+
COMMIT_AUTHOR_NAME: GitHub Action
47+
PULL_REQUEST_TITLE: "chore: Release"
48+
PULL_REQUEST_BODY: |
49+
This PR was opened by [release][1] GitHub action.
50+
When you're ready to do a release, you can merge this and release
51+
action will automatically publishes to npm registry.
52+
If you're not ready to do a release yet, that's fine, whenever you
53+
add more commits to master, this PR will be updated.
54+
55+
[1]: http://github.com/material-components/material-components-web/tree/master/.github/workflows/release-pull-request.yml
56+
PULL_REQUEST_BRANCH: chore/release
57+
BRANCH_SUFFIX: none

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: MDC Release
2+
3+
# This workflow does the following if repo does not have git tag that was updated in lerna.json
4+
# - creates release git tag
5+
# - publishes packages to NPM with latest tag
6+
#
7+
# This workflow is expected to run after merge of release pull requested created by release-pull-request workflow.
8+
9+
on:
10+
push:
11+
branches:
12+
- master
13+
paths:
14+
- 'lerna.json'
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Clone repository
21+
uses: actions/[email protected]
22+
- name: Checkout master branch
23+
# GITHUB_REF:11 gets `refs/heads/master` => `master`.
24+
# See https://github.com/actions/checkout/issues/6
25+
run: |
26+
git checkout "${GITHUB_REF:11}"
27+
git pull
28+
- name: Setup node
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: 10
32+
registry-url: https://registry.npmjs.org/
33+
- name: Install dependencies
34+
run: |
35+
npm install
36+
- name: Check if release tag is already created
37+
id: vars
38+
# Sets action's output parameter using `set-output`.
39+
# See https://help.github.com/en/github/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-output-parameter-set-output
40+
run: |
41+
MDC_CURRENT_VERSION="v$(npm run version --silent)"
42+
# If empty then set `mdc_version_changed` variable to `true`
43+
[[ -z $(git tag -l "$MDC_CURRENT_VERSION") ]] && echo "::set-output name=mdc_version_changed::true
44+
- name: Build packages
45+
if: steps.vars.outputs.mdc_version_changed == true
46+
run: |
47+
npm run dist
48+
node scripts/cp-pkgs.js
49+
node scripts/verify-pkg-main.js
50+
- name: Create release tag
51+
if: steps.vars.outputs.mdc_version_changed == true
52+
run: |
53+
MDC_CURRENT_VERSION="v$(npm run version --silent)"
54+
git config --local user.email "[email protected]"
55+
git config --local user.name "GitHub Action"
56+
git tag "$MDC_CURRENT_VERSION"
57+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
58+
git push origin "$MDC_CURRENT_VERSION"
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
- name: Publish to NPM registry
62+
if: steps.vars.outputs.mdc_version_changed == true
63+
run: npx lerna publish from-package --yes
64+
env:
65+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)