Merge branch 'main' of github.com:Climactic/tinyjobs #20
This file contains 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: | |
push: | |
branches: ["main"] | |
pull_request: | |
types: [opened, synchronize] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
jobs: | |
build: | |
name: Build and Release | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Cache turbo build setup | |
uses: actions/cache@v4 | |
with: | |
path: .turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- name: Setup bun | |
uses: oven-sh/setup-bun@v2 | |
- name: Install dependencies | |
run: bun install | |
- name: Lint | |
run: bun run lint # todo: replace with test once we have them | |
- name: Build | |
run: bun run build | |
- uses: changesets/action@v1 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
version: bun run ci:version | |
publish: bun run ci:publish | |
commit: "[ci] release" | |
title: "[ci] release" | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |