Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
parser: babel-eslint

parserOptions:
ecmaVersion: 6
sourceType: module
ecmaFeatures:
jsx: true
experimentalObjectRestSpread: true

env:
browser: true
es6: true

globals:
global: true

extends:
- eslint:recommended
- plugin:react/recommended

settings:
react:
version: detect
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @aviadmizrachi @frontegg-david @MaxArnautFrontegg @TomerFrontegg @mariavlasov
* @aviadmizrachi @frontegg-david @eldad-frontegg @rotemzif1 @amirjaron @MaxArnaut
53 changes: 0 additions & 53 deletions .github/actions/trigger-e2e-test/action.yaml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/scripts/generate-changelog.js

This file was deleted.

1 change: 0 additions & 1 deletion .github/scripts/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions .github/scripts/package.json

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/publish-alpha.yml

This file was deleted.

97 changes: 23 additions & 74 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ jobs:
createReleasePullRequest:
if: "!contains(join(github.event.pull_request.labels.*.name, ','), 'Release') && github.event.pull_request.merged == true"
runs-on: ubuntu-latest
container: cypress/browsers:node12.13.0-chrome80-ff74
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
node-version: 12
registry-url: 'https://npm.pkg.github.com'
- name: Install Dependencies and Build Packages
run: make init
- name: Run Components Test
run: make test-component
- name: Git Identity
run: |
git config --global user.name 'frontegg'
Expand All @@ -38,75 +39,50 @@ jobs:
echo "init-license=MIT" >> .npmrc
echo "always-auth=true" >> .npmrc
echo "registry=https://registry.npmjs.org" >> .npmrc
echo "_authToken=$NPM_TOKEN" >> .npmrc
echo "@frontegg:registry=https://registry.npmjs.org" >> .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}


- name: set Patch release
id: version_type_patch
run: |
echo "VERSION_TYPE=patch" >> $GITHUB_ENV

- name: Set Minor release
id: version_type_minor
if: contains(join(github.event.pull_request.labels.*.name, ','), 'Minor')
run: |
echo "VERSION_TYPE=minor" >> $GITHUB_ENV

- name: Commit Version UP
run: |
yarn lerna version $VERSION_TYPE --no-git-tag-version --yes --no-push --force-publish
yarn update-version
yarn lerna version patch --no-git-tag-version --yes --no-push --force-publish
yarn prettier-hook
- name: "Set Generated changelog"
uses: actions/github-script@v6
id: 'generated-changelog'
with:
result-encoding: string
script: |
const { generateChangeLog } = await import(`${process.env.GITHUB_WORKSPACE}/.github/scripts/index.js`);
return generateChangeLog({context, github, core})
- name: "Set incremented version"
uses: actions/github-script@v6
id: 'incremented-version'
with:
result-encoding: string
script: |
const {default: fs} = await import('fs');
const {version} = JSON.parse(fs.readFileSync('./lerna.json', {encoding: "utf-8"}));
return version;
- name: Commit changes
git add . && git commit -m "chore(release): publish `node -p 'require("./lerna.json").version'`"
- name: Set current CHANGELOG to output
id: changelog
shell: bash -ex {0}
id: 'cpr_commit_sha'
run: |
git add . && git commit -m "chore(release): publish ${{ steps.incremented-version.outputs.result }}"
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
version=$(node -p 'require("./lerna.json").version')
changelog=$(node -p "(function(){var changelog = require('fs').readFileSync('./CHANGELOG.md', {encoding: 'utf8'}); changelog = changelog.substring(changelog.indexOf('# [')); changelog = changelog.substring(changelog.indexOf('\n')).trim(); return changelog.substring(0, changelog.indexOf('# [') - 2)})()")
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A'}"
changelog="${changelog//$'\r'/'%0D'}"
echo $changelog
echo "::set-output name=version::${version}"
echo "::set-output name=changelog::${changelog}"
- name: Create Release Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3.5.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
path: ${{ secrets.GITHUB_WORKSPACE }}
commit-message: "Update v${{ steps.incremented-version.outputs.result }}"
commit-message: "Update v${{ steps.changelog.outputs.version }}"
committer: GitHub <noreply@github.com>
author: "${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
title: 'v${{ steps.incremented-version.outputs.result }}'
title: 'v${{ steps.changelog.outputs.version }}'
body: |
# v${{ steps.incremented-version.outputs.result }}
# v${{ steps.changelog.outputs.version }}

${{steps.generated-changelog.outputs.result}}
${{steps.changelog.outputs.changelog}}

labels: "Type: Release"
branch: "release/next"

- name: Publish Pre-Release version to NPM
id: publish_pre_release_version
run: |
version=$(node -p 'require("./lerna.json").version')
echo "::set-output name=LIB_VERSION::${version}"
echo "Publishing DEV version - v${version}-alpha.${{ github.run_id }}"
make move-package-json-to-dist
make prerelease-version-upgrade-${version}-alpha.${{ github.run_id }}
Expand All @@ -116,30 +92,3 @@ jobs:
make publish-packages-next
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Notify Slack on alpha version deployment
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: frontegg-alpha-versions
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://avatars.githubusercontent.com/u/67857107?s=40&v=4
SLACK_MESSAGE: '${{ steps.publish_pre_release_version.outputs.LIB_VERSION }}-alpha.${{ github.run_id }} has been released :rocket:'
SLACK_TITLE: 'A new @frontegg/react alpha version!'
SLACK_USERNAME: ${{ github.actor }}
SLACK_WEBHOOK: ${{ secrets.ROTEM_SLACK_WEBHOOK }}
MSG_MINIMAL: true
- name: Wait until NPM registry finished indexing the new version
uses: actions/github-script@v6
with:
script: |
const checkingVersion = '${{ steps.publish_pre_release_version.outputs.LIB_VERSION }}-alpha.${{ github.run_id }}';
const checkNpmVersions = require('./scripts/wait-for-npm-indexing.js');
await checkNpmVersions(github, ['@frontegg/react'], checkingVersion);

- name: "Call trigger-e2e-test action"
uses: ./.github/actions/trigger-e2e-test
with:
version: ${{ steps.publish_pre_release_version.outputs.LIB_VERSION }}-alpha.${{ github.run_id }}
sha: ${{ steps.cpr_commit_sha.outputs.sha }}
bot_app_id: ${{ secrets.GH_FRONTEGG_BOT_APP_ID }}
bot_app_key: ${{ secrets.GH_FRONTEGG_BOT_APP_SECRET }}
Loading