Skip to content

(▶) Publish Alpha Version #18

(▶) Publish Alpha Version

(▶) Publish Alpha Version #18

Workflow file for this run

name: "(▶) Publish Alpha Version"
on:
workflow_dispatch:
jobs:
createAlphaVersion:
runs-on: ubuntu-latest
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)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Install Dependencies and Build Packages
run: make init
- name: Git Identity
run: |
git config --global user.name 'frontegg'
git config --global user.email 'frontegg@users.noreply.github.com'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate with Registry
run: |
yarn logout
echo "init-author-name=Frontegg LTD" > .npmrc
echo "init-author-email=hello@frontegg.com" >> .npmrc
echo "init-author-url=https://frontegg.com" >> .npmrc
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: Commit Version UP
run: |
yarn lerna version patch --no-git-tag-version --yes --no-push --force-publish
yarn update-version
yarn prettier-hook
- 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: 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 }}
make pretty
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