Skip to content

Commit

Permalink
feat(javascript): add more comprehensive ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbutt committed Feb 21, 2024
1 parent 3396e14 commit 9b8202c
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 12 deletions.
72 changes: 69 additions & 3 deletions templates/javascript/github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,83 @@
name: CI

on: [push]
on:
push:
branches: [master]

pull_request:
branches: [master]

workflow_dispatch:

jobs:
build:
name: Build on ${{ matrix.os }}
name: Build on ${{ matrix.os }} and Node.js ${{ matrix.node-version }}

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: ["18.x", "20.x"]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"

- name: Install
run: pnpm install

- name: Lint
run: pnpm lint

- name: Test
run: pnpm test

release:
name: Release

if: github.ref == 'refs/heads/master'

needs: [build]

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup PNPM
uses: pnpm/action-setup@v3
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc
cache: "pnpm"

- name: Install
run: pnpm install

- name: Release
run: pnpm semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61 changes: 52 additions & 9 deletions templates/javascript/releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,52 @@
"presetConfig": {
"header": "Changelog",
"types": [
{ "type": "feat", "section": "🌟 Features" },
{ "type": "fix", "section": "🐛 Bug Fixes" },
{ "type": "chore", "hidden": true },
{ "type": "docs", "section": "📖 Documentation" },
{ "type": "style", "hidden": true },
{ "type": "refactor", "section": "✨ Refactor" },
{ "type": "perf", "section": "🚀 Performance" },
{ "type": "test", "hidden": true }
{
"type": "feat",
"section": "🌟 Features",
"hidden": false
},
{
"type": "fix",
"section": "🐛 Bug Fixes",
"hidden": false
},
{
"type": "chore",
"section": "🧰 Chores",
"hidden": false
},
{
"type": "docs",
"section": "📖 Documentation",
"hidden": false
},
{
"type": "style",
"section": "💅 Style",
"hidden": false
},
{
"type": "refactor",
"section": "✨ Refactor",
"hidden": false
},
{
"type": "perf",
"section": "🚀 Performance",
"hidden": false
},
{
"type": "test",
"section": "🧪 Tests",
"hidden": false
},
{
"type": "build",
"section": "🛠️ Build",
"hidden": false
},
{ "type": "ci", "section": "🤖 CI", "hidden": false }
]
}
}
Expand All @@ -50,7 +88,12 @@
"changelogTitle": "# Changelog"
}
],
"@semantic-release/npm",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
Expand Down

0 comments on commit 9b8202c

Please sign in to comment.