Skip to content

Commit

Permalink
build(core): publishing react in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
stevematney committed Sep 13, 2024
1 parent b1a7972 commit 7261976
Show file tree
Hide file tree
Showing 8 changed files with 11,692 additions and 5,704 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/react-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: React CI
env:
NODE_VERSION: 20
on:
push:
branches:
- "**"
paths:
- "*"
- "core/**"
- "website/**"
- "react/**"

permissions:
actions: read
checks: write # allow dependabot-triggered runs to create checks
contents: write # allow dependabot-triggered runs to create releases
deployments: read
issues: write
discussions: none
packages: read
pages: none
pull-requests: write # allow dependabot-triggered runs to comment on PRs
repository-projects: read
security-events: none
statuses: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: Install Dependencies
run: npm ci

- name: Run React Tests
run: npm run react:test

publish:
needs: [test]
name: Publish NPM Package
runs-on: ubuntu-latest
env:
GIT_AUTHOR_NAME: "im-pipeline-bot"
GIT_AUTHOR_EMAIL: ${{ secrets.COMMIT_BOT_EMAIL }}
GIT_COMMITTER_NAME: "im-pipeline-bot"
GIT_COMMITTER_EMAIL: ${{ secrets.COMMIT_BOT_EMAIL }}
GITHUB_TOKEN: ${{ secrets.PIPELINE_BOT_PAT }}
GH_TOKEN: ${{ secrets.PIPELINE_BOT_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PIPELINE_BOT_PAT }}
fetch-depth: 0
persist-credentials: true

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm

- name: Install Dependencies
run: npm ci

- name: Build
run: |
npm run core:build
npm run react:build
npm run website:build
git add -A
- name: Semantic Release - core
run: npx cross-env PACKAGE_NAME=core npx semantic-release

- name: Semantic Release - react
run: npx cross-env PACKAGE_NAME=react npx semantic-release
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
access=public
5 changes: 3 additions & 2 deletions core/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "text-mask-core",
"name": "@im-open/text-mask-core",
"private": false,
"version": "5.1.2",
"description": "Core of https://github.com/im-open/text-mask",
"main": "dist/textMaskCore.js",
Expand All @@ -10,7 +11,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/im-open/text-mask.git"
"url": "git+https://github.com/im-open/text-mask.git"
},
"homepage": "https://github.com/im-open/text-mask/core/#readme",
"keywords": [
Expand Down
Loading

0 comments on commit 7261976

Please sign in to comment.