Release v0.2.x: Multi-Platform Linking & Tree Views #12
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| branches: [main, dev] | |
| push: | |
| branches: [dev] | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| # Skip if commit message contains [skip ci] | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install all dependencies | |
| run: npm run install:all | |
| - name: Build shared types | |
| run: npm run build -w shared | |
| - name: Build server | |
| run: npm run build -w server | |
| - name: Build client | |
| run: npm run build -w client | |
| lint: | |
| runs-on: ubuntu-latest | |
| if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm run install:all | |
| - name: Build shared types | |
| run: npm run build -w shared | |
| - name: Check for TypeScript errors | |
| run: npm run build -w server && npm run build -w client | |
| bump-build: | |
| runs-on: ubuntu-latest | |
| needs: [test, lint] | |
| # Only run on push to dev (not PRs), and skip if already a version bump commit | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/dev' && !contains(github.event.head_commit.message, '[skip ci]') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Bump patch version | |
| run: | | |
| # Get current version | |
| CURRENT_VERSION=$(node -p "require('./package.json').version") | |
| # Split into parts | |
| MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1) | |
| MINOR=$(echo $CURRENT_VERSION | cut -d. -f2) | |
| PATCH=$(echo $CURRENT_VERSION | cut -d. -f3) | |
| # Increment patch | |
| NEW_PATCH=$((PATCH + 1)) | |
| NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" | |
| # Update package.json files | |
| npm version $NEW_VERSION --no-git-tag-version | |
| cd shared && npm version $NEW_VERSION --no-git-tag-version && cd .. | |
| cd client && npm version $NEW_VERSION --no-git-tag-version && cd .. | |
| cd server && npm version $NEW_VERSION --no-git-tag-version && cd .. | |
| # Commit and push | |
| git add package.json package-lock.json shared/package.json client/package.json server/package.json | |
| git commit -m "build: bump version to $NEW_VERSION [skip ci]" | |
| git push |