Skip to content

Commit

Permalink
ci: setup semantic release pipeline (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
MGREMY authored Oct 26, 2024
2 parents ddb2932 + 8a45e02 commit 3e1affc
Show file tree
Hide file tree
Showing 6 changed files with 1,205 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- main
- next
- next-major
- alpha
- beta

jobs:
release:
name: Release new version 🛠
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- name: Check out the code 🗄
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup NodeJS 💿
uses: actions/setup-node@v4
with:
node-version: 20

- name: Monorepo install
uses: ./.github/actions/setup

- name: Release new version 🛠
run: pnpm lib:release -- --ci --verbose --skip-nx-cache
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .nxreleaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"repositoryUrl": "https://github.com/themesberg/flowbite-angular/",
"tagFormat": "${PROJECT_NAME}@v${version}",
"branches": ["main"]
}

27 changes: 27 additions & 0 deletions libs/flowbite-angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,33 @@
},
"lint": {
"executor": "@nx/eslint:lint"
},
"semantic-release": {
"executor": "@theunderscorer/nx-semantic-release:semantic-release",
"options": {
"github": true,
"npm": true,
"changelog": true,
"branches": [
"main",
"next",
"next-major",
"+([0-9])?(.{+([0-9]),x}).x",
{
"name": "beta",
"prerelease": true
},
{
"name": "alpha",
"prerelease": true
}
],
"buildTarget": "flowbite-angular:build",
"outputPath": "{workspaceRoot}/dist/libs/flowbite-angular",
"tagFormat": "flowbite-angular@v${version}",
"commitMessage": "chore(flowbite-angular): ${nextRelease.version} [skip cli]\n\n${nextRelease.notes}"
}
}
}
}

1 change: 0 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"!{projectRoot}/src/test-setup.[jt]s"
]
},
"nxCloudAccessToken": "YTVmMTBiZGQtMDQxZS00ODViLTk0NTktYjJjZGFjNjRlZjlmfHJlYWQtd3JpdGU=",
"useInferencePlugins": false,
"defaultBase": "main"
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"preinstall": "pnpm dlx only-allow pnpm",
"lib:build": "nx run flowbite-angular:build && cp README.md LICENSE dist/libs/flowbite-angular",
"lib:lint": "nx run flowbite-angular:lint",
"lib:release": "nx run flowbite-angular:semantic-release",
"lib:test": "nx run flowbite-angular:test",
"prepare": "husky install",
"prettier": "nx format:check --base=HEAD",
Expand Down Expand Up @@ -69,6 +70,7 @@
"@nx/jest": "19.8.3",
"@nx/workspace": "19.8.3",
"@schematics/angular": "18.2.5",
"@theunderscorer/nx-semantic-release": "^2.12.0",
"@types/express": "4.17.14",
"@types/jest": "29.5.13",
"@types/node": "18.16.9",
Expand Down Expand Up @@ -110,3 +112,4 @@
}
}
}

Loading

0 comments on commit 3e1affc

Please sign in to comment.