Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/analyse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true

jobs:
# Quality Gate Stage
# STAGE 1: Quality Gate
lint:
name: Lint
runs-on: ubuntu-latest
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Test
uses: ./.github/actions/test

# Build Stage
# STAGE 2: Build
build:
name: Build
runs-on: ubuntu-latest
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Commitlint

on:
pull_request:
branches:
- main

jobs:
commitlint:
name: Validate commit messages
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Validate commit message
run: pnpm exec commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.sha }} --verbose
76 changes: 76 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Release

on:
workflow_dispatch:
inputs:
release-type:
description: "Release type"
required: true
type: choice
options: [latest, next]
preid:
description: "Prerelease identifier"
type: choice
options: ["", alpha, beta, rc, next]

jobs:
# STAGE 1: Versioning & Tagging
bump:
name: Version Bump
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
body: ${{ steps.release.outputs.body }}
steps:
- name: Generate Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.BOT_APP_ID }}
private-key: ${{ secrets.BOT_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0

- name: Release Please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ steps.app-token.outputs.token }}
skip-github-pull-request: true
prerelease: ${{ github.event.inputs.release-type == 'next' }}
prerelease-type: ${{ github.event.inputs.preid }}

# STAGE 2: Build & Publish
publish:
name: Build & Publish
needs: bump
if: ${{ needs.bump.outputs.release_created }}
runs-on: ubuntu-latest
environment: npm-publish
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.bump.outputs.tag_name }}

- name: Build
uses: ./.github/actions/build

- name: Publish to NPM
run: pnpm publish --no-git-checks --provenance --access public

- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.bump.outputs.tag_name }}
body: ${{ needs.bump.outputs.body }}
prerelease: ${{ github.event.inputs.release-type == 'next' }}
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm dlx commitlint --edit $1
9 changes: 9 additions & 0 deletions .release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"packages": {
".": {
"release-type": "node",
"package-name": "@ambitiondev/dynamic-url",
"initial-version": "0.0.1"
}
}
}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.0.1"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}
],
"devDependencies": {
"@commitlint/cli": "^20.3.1",
"@commitlint/config-conventional": "^20.3.1",
"@eslint/js": "^9.39.2",
"@types/qs": "^6.14.0",
Expand Down
Loading
Loading