Skip to content

Merge pull request #13 from PunGrumpy/release-please--branches--main-… #82

Merge pull request #13 from PunGrumpy/release-please--branches--main-…

Merge pull request #13 from PunGrumpy/release-please--branches--main-… #82

Workflow file for this run

name: πŸ€Ήβ€β™‚οΈ Continuous Integration
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
env:
SCOPRE_OWNER: '@pungrumpy'
jobs:
security:
name: πŸ”’ Security
uses: ./.github/workflows/security.yml
codeql:
needs: [security]
name: 🫸 CodeQL
uses: ./.github/workflows/codeql.yml
lint:
needs: [codeql]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node-version: [20, 21]
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.SCOPRE_OWNER }}
- name: 🍞 Setup Bun
uses: oven-sh/setup-bun@v1
- name: 🌡 Cache bun
uses: actions/cache@v3
id: cache-bun
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: πŸ”½ Install Dependencies
run: bun install
- name: βš–οΈ Lint
run: bun lint
release:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: [21]
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: [lint]
steps:
- name: πŸ’€ Automated Release
uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
token: ${{ secrets.GITHUB_TOKEN }}
bump-minor-pre-major: true
- 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.SCOPRE_OWNER }}
- name: 🍞 Setup Bun
uses: oven-sh/setup-bun@v1
- name: 🌡 Cache bun
uses: actions/cache@v3
id: cache-bun
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- 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
report:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
name: πŸ“Š Report
needs: [lint, release]
runs-on: ${{ matrix.os }}
if: failure()
steps:
- name: πŸ•‹ Send Issue
uses: JasonEtco/create-an-issue@v2
id: send-issue
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAILED_LOG: ${{ github.event.workflow }}
EVENT: ${{ github.event }}
with:
assignees: ${{ github.actor }}
update_existing: true
search_existing: true
filename: .github/ISSUE_TEMPLATE/failure_report.md