fix: Fix CI (test commit) #99
This file contains hidden or 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: Lerna Versioning and Publish | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
jobs: | |
versioning-and-publishing: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
registry-url: 'https://registry.npmjs.org' | |
node-version: '20' | |
- name: Install dependencies | |
run: | | |
npm install -g pnpm | |
npm install -g lerna | |
pnpm install | |
- name: Configure Git identity | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Run Lerna Version and Capture Tag | |
id: version | |
run: | | |
git tag > before_tags.txt | |
npx lerna version --conventional-commits --yes --no-push | |
git tag > after_tags.txt | |
if diff before_tags.txt after_tags.txt > /dev/null; then | |
echo "published=false" >> $GITHUB_OUTPUT | |
else | |
echo "published=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Publish to npm | |
if: steps.version.outputs.published == 'true' | |
run: | | |
npx lerna publish from-package --yes | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Push commit and tag | |
if: steps.version.outputs.published == 'true' | |
run: | | |
git push origin main | |
git push origin --tags | |
- name: Dispatch to Other Repo | |
if: steps.version.outputs.published == 'true' | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.SCH_ACCESS_TOKEN }} | |
repository: SteamClientHomebrew/SteamBrew | |
event-type: on-millennium-sdk-updated |