Skip to content

chore(deps): bump glob and semantic-release #1807

chore(deps): bump glob and semantic-release

chore(deps): bump glob and semantic-release #1807

Workflow file for this run

name: Module CI/CD
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
issues: write
pull-requests: write
jobs:
lint-commit-message:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint commit messages
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
shell: bash
run: npm ci
- name: Run tests
shell: bash
run: npm run coverageTest
- name: Build project
shell: bash
run: npm run build
- uses: actions/upload-artifact@v4.6.2
with:
name: dist
path: dist
retention-days: 1
- name: Preview release
id: preview
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GITHUB_REF=${{ github.head_ref }}
chmod +x .github/scripts/preview-release.sh
.github/scripts/preview-release.sh ${{ github.head_ref }}
- name: Comment PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
const preview = fs.readFileSync('preview.md', 'utf8');
// Check if we already have a preview comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const botComment = comments.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('## 📦 Release Preview')
);
if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: preview
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: preview
});
}
release:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs:
build-and-test
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
token: ${{ secrets.semantic_release }}
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install dependencies
run: npm ci
- uses: actions/download-artifact@v5.0.0
with:
name: dist
path: dist
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.semantic_release }}
run: npx semantic-release