Skip to content

Commit

Permalink
chore: CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nytamin committed Nov 13, 2023
1 parent 622a38a commit 50e1fe2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/publish-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ jobs:
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
echo "env NPM_TOKEN not set!"
else
echo "Publish Release"
echo "publish=nightly" >> $GITHUB_OUTPUT
fi
- name: Prepare Environment
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
yarn
env:
Expand All @@ -39,7 +40,7 @@ jobs:
with:
remove-version-tag-prefix: false
- name: Bump version to nightly
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
COMMIT_TIMESTAMP=$(git log -1 --pretty=format:%ct HEAD)
COMMIT_DATE=$(date -d @$COMMIT_TIMESTAMP +%Y%m%d-%H%M%S)
Expand All @@ -49,18 +50,18 @@ jobs:
env:
CI: true
- name: Build
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
yarn build
env:
CI: true
- name: Set .npmrc file
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm whoami
- name: Git commit
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github CI"
Expand All @@ -69,7 +70,7 @@ jobs:
env:
CI: true
- name: Publish nightly to NPM
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: yarn lerna:publish from-package --dist-tag nightly --no-verify-access --yes
env:
CI: true
9 changes: 5 additions & 4 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,28 @@ jobs:
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
echo "env NPM_TOKEN not set!"
else
echo "Publish Release"
echo "publish=prerelease" >> $GITHUB_OUTPUT
fi
- name: Prepare Environment
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
yarn
env:
CI: true
- name: Build
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
yarn build
env:
CI: true
- name: Set .npmrc file
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm whoami
- name: Publish prerelease to NPM
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: yarn lerna:publish from-package --dist-tag prerelease --no-verify-access --yes
env:
CI: true
9 changes: 5 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,28 @@ jobs:
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
echo "env NPM_TOKEN not set!"
else
echo "Publish Release"
echo "publish=release" >> $GITHUB_OUTPUT
fi
- name: Prepare Environment
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
yarn
env:
CI: true
- name: Build
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
yarn build
env:
CI: true
- name: Set .npmrc file
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm whoami
- name: Publish to NPM
if: ${{ steps.do-publish.outputs.publish }}
if: ${{ steps.check-npm-token.outputs.publish }}
run: yarn lerna:publish from-package --no-verify-access --yes
env:
CI: true

0 comments on commit 50e1fe2

Please sign in to comment.