Skip to content

chore: reduce size of social-card #179

chore: reduce size of social-card

chore: reduce size of social-card #179

name: Semantic Release
on:
push:
branches: [main]
# Skip running on release commits (already created)
paths-ignore:
- 'testplanit/CHANGELOG.md'
permissions:
contents: write
issues: write
pull-requests: write
actions: write
jobs:
release:
name: Release
runs-on: [self-hosted]
# Skip release commits
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
env:
NODE_OPTIONS: "--max-old-space-size=6144"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Install dependencies
run: |
cd testplanit
pnpm install --frozen-lockfile --ignore-scripts
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
run: |
cd testplanit
npx semantic-release 2>&1 | tee release-output.txt
# Extract the version if a release was made (macOS-compatible)
if grep -q "Published release" release-output.txt; then
# Use sed instead of grep -oP for macOS compatibility
VERSION=$(grep "Published release" release-output.txt | sed -E 's/.*Published release ([0-9]+\.[0-9]+\.[0-9]+).*/\1/' | head -1)
if [ -n "$VERSION" ] && [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "version=v${VERSION}" >> $GITHUB_OUTPUT
echo "released=true" >> $GITHUB_OUTPUT
else
echo "Warning: Found 'Published release' but could not extract version number"
echo "released=false" >> $GITHUB_OUTPUT
fi
else
echo "released=false" >> $GITHUB_OUTPUT
fi
- name: Trigger Docker build
if: steps.release.outputs.released == 'true' && steps.release.outputs.version != '' && steps.release.outputs.version != 'v'
env:
GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
run: |
VERSION="${{ steps.release.outputs.version }}"
if [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Triggering Docker build for version: $VERSION"
gh workflow run release.yml -f tag=$VERSION
else
echo "Error: Invalid version format: $VERSION"
exit 1
fi