Tables update #197
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
name: Origyn - Origyn-ART-UI package publishing | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- stage | |
jobs: | |
origyn-art-ui-publish: | |
if: contains(github.event.head_commit.message, '#patch') || contains(github.event.head_commit.message, '#minor') || contains(github.event.head_commit.message, '#major') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.12.1] | |
steps: | |
- name: Checkout commits for ${{ steps.extract_branch.outputs.branch }} branch | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Reconfigure git | |
run: | | |
git config user.name runner | |
git config user.email [email protected] | |
git config github.token ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: install dependencies and build | |
run: | | |
npm ci | |
npm i -g jest | |
npm run build | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
# - name: Origyn_ART_UI - testing | |
# run: | | |
# npm run test | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
## DEV publish patch | |
- name: Dev publish patch | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'patch') | |
run: | | |
git add . && git commit -m "prepare package lock files" || true | |
npm version patch | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: Push changes | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'patch') | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.NODE_AUTH_TOKEN }} | |
branch: ${{ github.ref }} | |
## STAGE publish patch | |
- name: Stage publish patch | |
if: github.ref == 'refs/heads/stage' && contains(github.event.head_commit.message, 'patch') | |
run: | | |
git add . && git commit -m "prepare package lock files" || true | |
npm version patch | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: Push changes | |
if: github.ref == 'refs/heads/stage' && contains(github.event.head_commit.message, 'patch') | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.token }} | |
branch: ${{ github.ref }} | |
## PROD publish patch | |
- name: Prod publishing patch | |
if: github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'patch') | |
run: | | |
git add . && git commit -m "prepare package lock files" || true | |
npm version patch | |
npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: Push changes | |
if: github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, 'patch') | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.token }} | |
branch: ${{ github.ref }} | |
## DEV publish minor | |
- name: Dev publishing minor | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'minor') | |
run: | | |
git add . && git commit -m "prepare package lock files" || true | |
npm version minor | |
npm publish | |
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: Push changes | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'minor') | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.token }} | |
branch: ${{ github.ref }} | |
- name: Merge to stage | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'minor') | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
message: 'merge minor version ${{ env.TAG_NAME }}' | |
target_branch: 'stage' | |
github_token: ${{ github.token }} | |
## DEV publish major | |
- name: DEV publishing major | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'major') | |
run: | | |
git add . && git commit -m "prepare package lock files" || true | |
npm version major | |
npm publish | |
echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} | |
- name: Push changes | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'major') | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ github.token }} | |
branch: ${{ github.ref }} | |
- name: Merge to prod | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'major') | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
message: 'merge major version ${{ env.TAG_NAME }}' | |
target_branch: 'main' | |
github_token: ${{ github.token }} | |
- name: Merge to stage | |
if: github.ref == 'refs/heads/develop' && contains(github.event.head_commit.message, 'major') | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
message: 'merge major version ${{ env.TAG_NAME }}' | |
target_branch: 'stage' | |
github_token: ${{ github.token }} |