Skip to content

ci: add release filter #7

ci: add release filter

ci: add release filter #7

Workflow file for this run

name: Publish Stable
on:
push:
branches:
- main
- stable
jobs:
publish:
strategy:
fail-fast: false
matrix:
include:
- package: '@lasfoiawbp/test1'
folder: 'packages/test1'
- package: '@lasfoiawbp/test2'
folder: 'packages/test2'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'
always-auth: true
cache: pnpm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Install Dependencies
run: pnpm install
- name: Build Project
run: pnpm --filter $${{ matrix.package }} build
- name: Release
id: 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: |
pnpm --filter $${{ matrix.package }} semantic-release
- name: Configure git, commit and push!
id: commmit
if: steps.release.outcome == 'success'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: release ${{ matrix.package }}@$(pnpm version --json | jq -r '.${{ matrix.package }}') [skip ci]" || echo "No changes to commit"
git push