Skip to content

Commit 69f9b37

Browse files
authored
Merge pull request siemens#4 from siemens/next
build(ci): add GitHub actions to build and release
2 parents 06e5128 + f5e70be commit 69f9b37

File tree

12 files changed

+9222
-2876
lines changed

12 files changed

+9222
-2876
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
- maintenance/*
8+
- next
79
pull_request:
810
jobs:
911
build-and-test:
@@ -23,3 +25,29 @@ jobs:
2325
- run: npm run lint:commit
2426
- run: npm run lint
2527
- run: npm run plugin:test
28+
29+
release:
30+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || startsWith(github.ref, 'refs/heads/maintenance/')
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: write # to be able to publish a GitHub release
34+
issues: write # to be able to comment on released issues
35+
pull-requests: write # to be able to comment on released pull requests
36+
id-token: write # to enable use of OIDC for npm provenance
37+
needs: build-and-test
38+
steps:
39+
- uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
- name: Use Node.js 22.x
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: 22.x
46+
cache: 'npm'
47+
- run: npm ci
48+
- run: npm run build
49+
- name: Semantic Release
50+
run: npx semantic-release
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.releaserc.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"branches": [
3+
{
4+
"name": "maintenance/+([0-9])?(.{+([0-9]),x}).x",
5+
"channel": "${name.replace(/^maintenance\\//g, \"\")}"
6+
},
7+
"main",
8+
{
9+
"name": "next",
10+
"channel": "next",
11+
"prerelease": true
12+
}
13+
],
14+
"plugins": [
15+
"@semantic-release/commit-analyzer",
16+
"@semantic-release/release-notes-generator",
17+
[
18+
"@semantic-release/npm",
19+
{
20+
"pkgRoot": "dist/commitlint-config"
21+
}
22+
],
23+
[
24+
"@semantic-release/npm",
25+
{
26+
"pkgRoot": "dist/eslint-config-angular"
27+
}
28+
],
29+
[
30+
"@semantic-release/npm",
31+
{
32+
"pkgRoot": "dist/eslint-config-typescript"
33+
}
34+
],
35+
[
36+
"@semantic-release/npm",
37+
{
38+
"pkgRoot": "dist/eslint-plugin-defaultvalue"
39+
}
40+
],
41+
[
42+
"@semantic-release/npm",
43+
{
44+
"pkgRoot": "dist/prettier-config"
45+
}
46+
],
47+
[
48+
"@semantic-release/npm",
49+
{
50+
"pkgRoot": "dist/stylelint-config-scss"
51+
}
52+
],
53+
"@semantic-release/github"
54+
]
55+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This project uses semantic release.
2+
3+
See [GitHub releases](https://github.com/siemens/lint/releases/) for a changelog.

CONTRIBUTING.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,11 @@ deprecation note and appear in the changelog.
463463

464464
## Releasing
465465

466-
To create a new release you need to bump the package version in **package.json**,
467-
update the changelog, commit, tag.
466+
We use [semantic-release](https://semantic-release.gitbook.io/semantic-release) which automates all release tasks.
468467

469-
We use `semantic-release` which automates all these tasks.
470-
471-
TODO: Add details how to use `semantic-release` etc.
468+
- to create a new release push changes to the `main` branch
469+
- to create a pre-release push changes to the `next` branch
470+
- to create a maintenance release push changes to a branch following this pattern: `maintenance/N.N.x` / `maintenance/N.x.x` / `maintenance/N.x` branch where `N` is any existing version
472471

473472
## Attribution
474473

commitlint-config/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "@siemens/commitlint-config",
3-
"version": "1.2.2",
3+
"version": "0.0.0-development",
44
"description": "Configuration for commitlint.",
55
"files": [
66
"*.js",
77
"*.md"
88
],
99
"repository": {
1010
"type": "git",
11-
"url": "[email protected]:siemens/lint.git"
11+
"url": "git+ssh://git@github.com/siemens/lint.git"
1212
},
1313
"author": {
1414
"name": "Siemens",
@@ -20,6 +20,9 @@
2020
"siemens",
2121
"lint"
2222
],
23+
"publishConfig": {
24+
"access": "public"
25+
},
2326
"license": "MIT",
2427
"type": "module",
2528
"peerDependencies": {

eslint-config-angular/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@siemens/eslint-config-angular",
3-
"version": "1.2.2",
3+
"version": "0.0.0-development",
44
"description": "Configuration for linting Angular TypeScript and templates using Angular ESLint.",
55
"files": [
66
"*.mjs",
@@ -14,7 +14,7 @@
1414
},
1515
"repository": {
1616
"type": "git",
17-
"url": "[email protected]:siemens/lint.git"
17+
"url": "git+ssh://git@github.com/siemens/lint.git"
1818
},
1919
"author": {
2020
"name": "Siemens",
@@ -26,6 +26,9 @@
2626
"siemens",
2727
"lint"
2828
],
29+
"publishConfig": {
30+
"access": "public"
31+
},
2932
"license": "MIT",
3033
"peerDependencies": {
3134
"@eslint/js": "^9.9.1",

eslint-config-typescript/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@siemens/eslint-config-typescript",
3-
"version": "1.2.2",
3+
"version": "0.0.0-development",
44
"description": "Configuration for linting TypeScript using typescript-eslint.",
55
"files": [
66
"*.mjs",
@@ -9,7 +9,7 @@
99
"main": "./index.mjs",
1010
"repository": {
1111
"type": "git",
12-
"url": "[email protected]:siemens/lint.git"
12+
"url": "git+ssh://git@github.com/siemens/lint.git"
1313
},
1414
"author": {
1515
"name": "Siemens",
@@ -21,6 +21,9 @@
2121
"siemens",
2222
"lint"
2323
],
24+
"publishConfig": {
25+
"access": "public"
26+
},
2427
"license": "MIT",
2528
"peerDependencies": {
2629
"@eslint/js": "^9.9.1",

eslint-plugin-defaultvalue/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@siemens/eslint-plugin-defaultvalue",
3-
"version": "1.2.2",
3+
"version": "0.0.0-development",
44
"main": "lib/index.js",
55
"type": "module",
66
"description": "Automatically enrich TSDoc comments with default values or check if they are all correct.",
77
"repository": {
88
"type": "git",
9-
"url": "[email protected]:siemens/lint.git"
9+
"url": "git+ssh://git@github.com/siemens/lint.git"
1010
},
1111
"author": {
1212
"name": "Siemens",
@@ -18,6 +18,9 @@
1818
"siemens",
1919
"lint"
2020
],
21+
"publishConfig": {
22+
"access": "public"
23+
},
2124
"license": "MIT",
2225
"peerDependencies": {
2326
"eslint": "^8.0.0||^9.0.0",

0 commit comments

Comments
 (0)