-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from absurdprofit/next
Test merge
- Loading branch information
Showing
144 changed files
with
15,151 additions
and
23,707 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Github Pages Deploy on Merge to Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.17.0" | ||
cache: "npm" | ||
|
||
- name: Cache Node modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: | | ||
npm install | ||
npm install --global lerna # If lerna is not installed globally in your CI environment | ||
- name: Deploy with Lerna | ||
run: npx lerna run deploy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Publish to npm | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
- beta | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
registry-url: "https://registry.npmjs.org" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Get branch name and commit hash | ||
id: git-info | ||
run: | | ||
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> $GITHUB_ENV | ||
COMMIT_HASH=$(git rev-parse --short HEAD) | ||
echo "COMMIT_HASH=${COMMIT_HASH}" >> $GITHUB_ENV | ||
- name: Conditional Version Update | ||
if: startsWith(env.BRANCH_NAME, 'next') || startsWith(env.BRANCH_NAME, 'beta') | ||
run: | | ||
TAG_NAME=${{ env.BRANCH_NAME }} | ||
COMMIT_HASH=${{ env.COMMIT_HASH }} | ||
lerna list --json | jq -r '.[] | .location' | while read -r package; do | ||
CURRENT_VERSION=$(jq -r '.version' $package/package.json) | ||
NEW_VERSION="${CURRENT_VERSION}-${TAG_NAME}.${COMMIT_HASH}" | ||
jq ".version = \"${NEW_VERSION}\"" $package/package.json > $package/package.json.tmp && mv $package/package.json.tmp $package/package.json | ||
done | ||
- name: Assume unchanged for all package.json files | ||
run: | | ||
git ls-files -m | grep 'package.json' | xargs -I {} git update-index --assume-unchanged {} | ||
- name: Publish packages | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
if [[ "${GITHUB_REF##*/}" == "main" ]]; then | ||
DIST_TAG="latest" | ||
else | ||
DIST_TAG="${GITHUB_REF##*/}" | ||
fi | ||
npx lerna publish from-package --yes --dist-tag $DIST_TAG |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ build | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.vscode | ||
.vscode | ||
.tsbuildinfo |
Oops, something went wrong.