Skip to content

Commit

Permalink
ci: done
Browse files Browse the repository at this point in the history
  • Loading branch information
AshGw committed Jun 11, 2024
1 parent 524b83f commit 1e85ebb
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Prepare
description: Prepares the repo for a CI job

inputs:
node-version:
required: false
description: '`node-version` passed to `actions/setup-node`.'
default: 18.17.0

runs:
using: 'composite'
steps:
- name: Configure Git
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name ${GITHUB_ACTOR}
shell: bash
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'
- run: pnpm install --frozen-lockfile --ignore-scripts
shell: bash
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write

concurrency:
group: Release
cancel-in-progress: false

jobs:
lint:
uses: ./.github/workflows/lint.yml
green-light:
if: always()
needs:
- lint
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
id: all-green
with:
jobs: ${{ toJSON(needs)}}
npm:
needs:
- green-light
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/prepare

- name: Build
run: pnpm run build

- name: Release
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > ~/.npmrc
#!/bin/bash
if ! pnpm can-npm-publish; then
exit 0
fi
pnpm publish --access public
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Lint Code

on:
pull_request:
workflow_dispatch:
workflow_call:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:ts

0 comments on commit 1e85ebb

Please sign in to comment.