Skip to content

Commit

Permalink
add publish workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Aug 13, 2023
1 parent 528fb4a commit 184731f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 57 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/onPullRequestMerged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,30 @@ jobs:
labels: "Type: Release"
branch: "release/next"

# - name: Publish Pre-Release version to NPM
# id: publish_pre_release_version
# run: |
# version=$(node -p 'require("./package.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
# git add .
# git commit -m "chore: prelrease version"
# make publish-packages-next
# env:
# NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish Pre-Release version to NPM
id: publish_pre_release_version
run: |
version=$(node -p 'require("./package.json").version')
echo "::set-output name=LIB_VERSION::${version}"
echo "Publishing DEV version - v${version}-alpha.${{ github.run_id }}"
yarn version --new-version "${version}-alpha.${{ github.run_id }}" --no-git-tag-version --no-commit-hooks
git add .
git commit -m "chore: prelrease version"
yarn pack
npm publish --tag next
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_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 : 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
29 changes: 2 additions & 27 deletions .github/workflows/onPush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,5 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

# - name: Pre-Pack Packages
# run: yarn prepack

- name: Authenticate with Registry
run: |
yarn logout
echo "init-author-name=Frontegg LTD" > .npmrc
echo "[email protected]" >> .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: Pack Package
run: |
yarn pack
- name: Publish @frontegg/react-native version to NPM
run: npm publish --tag latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Pre-Pack Packages
run: yarn prepack
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@frontegg/react-native",
"version": "1.0.3-0",
"version": "1.0.2",
"description": "Frontegg React-Native SDK",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -56,8 +56,8 @@
"@react-native-async-storage/async-storage": "^1.19.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.0.2",
"@evilmartians/lefthook": "^1.2.2",
"@commitlint/config-conventional": "^17.0.2",
"@react-native-community/eslint-config": "^3.0.2",
"@release-it/conventional-changelog": "^5.0.0",
"@types/jest": "^28.1.2",
Expand All @@ -81,10 +81,10 @@
"@types/react": "17.0.21"
},
"peerDependencies": {
"@react-navigation/native": "*",
"@react-navigation/native-stack": "*",
"react": "*",
"react-native": "*"
"react-native": "*",
"@react-navigation/native": "*",
"@react-navigation/native-stack": "*"
},
"engines": {
"node": ">= 16.0.0"
Expand Down

0 comments on commit 184731f

Please sign in to comment.