Add optional startup message config #259
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: π€ΉββοΈ Continuous Integration | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
SCOPE_OWNER: '@pungrumpy' | |
jobs: | |
codeql: | |
name: π«Έ CodeQL | |
uses: ./.github/workflows/codeql.yml | |
lint: | |
needs: [codeql] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [22] | |
name: βοΈ Lint | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π« Checkout Code | |
uses: actions/checkout@v4 | |
- name: π¦ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
scope: ${{ env.SCOPE_OWNER }} | |
- name: π Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: π΅ Cache bun | |
uses: actions/cache@v4 | |
id: cache-bun | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ matrix.node-version }}-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun-${{ matrix.node-version }}- | |
${{ runner.os }}-bun- | |
${{ runner.os }}- | |
- name: π½ Install Dependencies | |
run: bun install | |
- name: βοΈ Lint | |
run: bun lint | |
test: | |
needs: [lint] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [22] | |
name: π§ͺ Test | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: π« Checkout Code | |
uses: actions/checkout@v4 | |
- name: π¦ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
scope: ${{ env.SCOPE_OWNER }} | |
- name: π Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: π΅ Cache bun | |
uses: actions/cache@v4 | |
id: cache-bun | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ matrix.node-version }}-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun-${{ matrix.node-version }}- | |
${{ runner.os }}-bun- | |
${{ runner.os }}- | |
- name: π½ Install Dependencies | |
run: bun install | |
- name: π§ͺ Test | |
run: bun run test:ci | |
release: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [22] | |
if: ${{ github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip ci]') }} | |
name: π Release | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: ${{ matrix.os }} | |
needs: [test] | |
steps: | |
- name: π€ Automated Release | |
uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: node | |
- name: π Checkout | |
uses: actions/checkout@v4 | |
- name: π¦ Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: https://registry.npmjs.org/ | |
scope: ${{ env.SCOPE_OWNER }} | |
- name: π Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
- name: π΅ Cache bun | |
uses: actions/cache@v4 | |
id: cache-bun | |
with: | |
path: ~/.bun | |
key: ${{ runner.os }}-bun-${{ matrix.node-version }}-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun-${{ matrix.node-version }}- | |
${{ runner.os }}-bun- | |
${{ runner.os }}- | |
- name: π½ Install Dependencies | |
run: bun install | |
- name: π·οΈ Tag stable versions | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" | |
git tag -d stable || true | |
git push origin :stable || true | |
git tag -a stable -m "chore: release stable version ${{ steps.release.outputs.tag_name }}" | |
git push origin stable | |
- name: π¦ Publish | |
if: ${{ steps.release.outputs.release_created }} | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
continue-on-error: true |