-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
97 changed files
with
3,850 additions
and
470 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Create changelog changesets | ||
on: | ||
push: | ||
branches: | ||
- v2-release/** | ||
|
||
jobs: | ||
create-changelog: | ||
name: Create changelog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
- name: Install dependencies | ||
run: yarn --immutable | ||
- name: Extract version number from branch name | ||
id: version_number | ||
run: | | ||
branchName=${{ github.ref }} | ||
echo "result=${branchName##*/}" >> $GITHUB_OUTPUT | ||
- name: Create PR with changelog | ||
uses: changesets/action@v1 | ||
with: | ||
commit: 'ci: version packages' | ||
title: 'ci: version packages v${{ steps.version_number.outputs.result }}' | ||
env: | ||
# Needs access to publish to npm | ||
# refresh token before Saturday, May 25, 2024 | ||
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Helper - Auto-merge PR with `automerge` label | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- labeled | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
- edited | ||
branches: | ||
- v2-develop | ||
|
||
jobs: | ||
automerge: | ||
runs-on: ubuntu-latest | ||
if: ${{ startsWith(github.head_ref, 'v2' )}} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- id: automerge | ||
name: automerge | ||
uses: 'pascalgn/[email protected]' | ||
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Publish prod version and create sync PR | ||
on: | ||
push: | ||
branches: | ||
- v2 | ||
|
||
jobs: | ||
publish-and-create-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: yarn --immutable | ||
- name: Publish Production version | ||
# run: yarn changeset publish | ||
run: echo publish package | ||
env: | ||
# Needs access to publish to npm | ||
# refresh token before Saturday, May 25, 2024 | ||
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | ||
- name: Create PR to develop | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr create -B v2-develop --title 'chore: automatic Sync v2->v2-develop PR' --body 'This Pull Request is generated automatically with changes pushed into `v2` branch. `v2` and `v2-develop` branches should be in-sync.' --label automerge || true | ||
- name: Merge created PR | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: gh pr merge --auto --merge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
branches: | ||
- v2 | ||
- v2-develop | ||
- '!changeset-release/**' | ||
pull_request: | ||
types: | ||
- opened | ||
|
@@ -12,6 +13,10 @@ on: | |
- ready_for_review | ||
- edited | ||
|
||
env: | ||
SONAR_TOKEN_REACT: ${{ secrets.SONAR_TOKEN_REACT }} | ||
SONAR_TOKEN_VUE: ${{ secrets.SONAR_TOKEN_VUE }} | ||
|
||
jobs: | ||
cache: | ||
name: Create cache for all steps | ||
|
@@ -27,22 +32,6 @@ jobs: | |
- name: Install dependencies | ||
run: NOT_GENERATE_ICON=true && yarn --immutable | ||
|
||
verify-collaborator: | ||
name: Verify collaborator | ||
needs: [cache] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
isCollaborator: ${{ steps.collaborator.outputs.isCollaborator }} | ||
steps: | ||
- id: collaborator | ||
name: Check if user is a collaborator | ||
run: | | ||
curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | ||
"https://api.github.com/repos/${{ github.repository }}/collaborators/${{ github.actor }}" \ | ||
| grep -q "Collaborator not found" \ | ||
&& echo "isCollaborator=false" >> $GITHUB_OUTPUT \ | ||
|| echo "isCollaborator=true" >> $GITHUB_OUTPUT | ||
commit-lint: | ||
name: Validate PR Title (conventional-commit) | ||
needs: [cache] | ||
|
@@ -131,7 +120,7 @@ jobs: | |
|
||
cypress-vue: | ||
name: Run cypress tests(Vue) | ||
needs: [cache, lint, verify-collaborator] | ||
needs: [cache, lint] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -158,7 +147,7 @@ jobs: | |
- name: Post-Cypress (generate coverage) | ||
run: cd apps/test/vue; yarn generate-coverage | ||
- name: SonarCloud Scan | ||
if: ${{ needs.verify-collaborator.outputs.isCollaborator == 'true' && (success() || failure()) }} | ||
if: ${{ env.SONAR_TOKEN_VUE }} | ||
uses: SonarSource/[email protected] | ||
with: | ||
projectBaseDir: packages/sfui/frameworks/vue | ||
|
@@ -168,7 +157,7 @@ jobs: | |
|
||
cypress-react: | ||
name: Run cypress tests(React) | ||
needs: [cache, lint, verify-collaborator] | ||
needs: [cache, lint] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -193,7 +182,7 @@ jobs: | |
- name: Post-Cypress (generate coverage) | ||
run: cd apps/test/react; yarn generate-coverage | ||
- name: SonarCloud Scan | ||
if: ${{ needs.verify-collaborator.outputs.isCollaborator == 'true' && (success() || failure()) }} | ||
if: ${{ env.SONAR_TOKEN_REACT }} | ||
uses: SonarSource/[email protected] | ||
with: | ||
projectBaseDir: packages/sfui/frameworks/react | ||
|
@@ -232,18 +221,31 @@ jobs: | |
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | ||
|
||
release-next: | ||
name: Release release candidate | ||
release-rc: | ||
name: Release RC package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: Install dependencies | ||
run: yarn --immutable | ||
- name: Save head commit message | ||
id: commit_message | ||
run: echo "result=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT | ||
- name: Publish release-candidate | ||
# If this is any `v2-release/**` branch AND last commit is made by changeset action and its commit message is with "rc" suffix, logic can be found in "release-changeset-changelog.yml | ||
if: ${{ startsWith( github.ref, 'refs/heads/v2-release' ) && steps.commit_message.output.result == '[ci] - release rc' }} | ||
run: echo "Publish now" | ||
- name: Publish release-candidate version | ||
# If this is any `v2-release/**` branch AND last commit is made by changeset action and its commit message is with "ci: release (rc)", this happens only after merging changesets changelog PR | ||
if: "${{ startsWith( github.event.pull_request.head.ref, 'v2-release' ) && contains( steps.commit_message.outputs.result, 'ci: version packages (rc)' ) }}" | ||
run: yarn changeset publish | ||
env: | ||
# Needs access to publish to npm | ||
# refresh token before Saturday, May 25, 2024 | ||
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.