chore(packages): wip #51
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: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
name: Publish to NPM | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Configure Git | |
run: | | |
git config --global user.name "${{ secrets.GIT_USER_NAME }}" | |
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}" | |
# - name: "NPM Identity" | |
# env: | |
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
# run: | | |
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | |
- name: "GitHub Package Registry Identity" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > .npmrc | |
echo "@exile-watch:registry=https://npm.pkg.github.com/" >> .npmrc | |
- name: Check if package-lock.json changed | |
id: package-lock-changed | |
run: | | |
git diff --quiet HEAD^ HEAD -- package-lock.json || echo ::set-output name=changed::true | |
- name: Install dependencies | |
if: steps.package-lock-changed.outputs.changed == 'true' | |
run: npm ci | |
- if: success() | |
env: | |
CI: true | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: lerna publish --yes |