Skip to content

Commit 294d4b5

Browse files
committed
ci: add release it
1 parent 952df26 commit 294d4b5

File tree

5 files changed

+21951
-38167
lines changed

5 files changed

+21951
-38167
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
1-
name: CI Release
1+
name: ⚠️ Release
22
on:
3+
workflow_dispatch:
34
push:
4-
branches:
5-
- master
5+
branches: [master]
6+
paths:
7+
- 'projects/**'
68

79
jobs:
8-
release:
9-
runs-on: ubuntu-22.04
10+
run-release:
11+
name: Release
12+
if: "!contains(github.event.head_commit.message, 'chore(release)')"
13+
runs-on: ubuntu-latest
14+
env:
15+
GH_TOKEN: ${{ secrets.ANGULAR_RU_BOT_PAT }}
1016
steps:
11-
- uses: actions/checkout@v4
17+
- uses: taiga-family/ci/actions/setup/checkout@v1.65.1
1218
with:
13-
fetch-depth: '0'
14-
persist-credentials: false
15-
16-
- name: Setup Node.js and Cache
17-
uses: ./.github/actions/nodejs
18-
19-
- name: Setup GIT username and NPM token
20-
run: |
21-
git config --global user.name "angular-ru-bot"
22-
git config --global user.email "[email protected]"
23-
git config remote.origin.url https://x-access-token:${{ secrets.ANGULAR_RU_BOT_PAT }}@github.com/$GITHUB_REPOSITORY
24-
npm config set '//registry.npmjs.org/:_authToken' "${{ secrets.NPM_TOKEN }}"
25-
NPM_WHOAMI_OUTPUT=$(npm whoami)
26-
echo "::debug::npm whoami: ${NPM_WHOAMI_OUTPUT}"
27-
28-
- name: Lerna version
29-
if: always()
30-
run: npx lerna version
31-
32-
- name: Build libraries
33-
run: npx nx run-many --target=build --parallel
34-
35-
- name: Publish
36-
if: always()
37-
run: npx nx run-many --target=publish
19+
fetch-depth: 0
20+
token: ${{ secrets.ANGULAR_RU_BOT_PAT }}
21+
- uses: taiga-family/ci/actions/setup/[email protected]
22+
- uses: taiga-family/ci/actions/setup/config/[email protected]
23+
with:
24+
token: ${{ secrets.ANGULAR_RU_BOT_PAT }}
25+
- uses: taiga-family/ci/actions/setup/config/[email protected]
26+
with:
27+
token: ${{ secrets.NPM_TOKEN }}
3828

39-
concurrency:
40-
group: release-${{ github.head_ref }}
41-
cancel-in-progress: true
29+
- run: npx release-it --increment --ci
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.ANGULAR_RU_BOT_PAT }}

.release-it.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"git": {
3+
"commitMessage": "chore(release): v${version}",
4+
"tagName": "v${version}"
5+
},
6+
"github": {
7+
"release": true,
8+
"releaseNotes": "git log --no-merges --pretty=format:\"* %s %h\" ${latestTag}...main"
9+
},
10+
"npm": {
11+
"publish": false,
12+
"skipChecks": true,
13+
"allowSameVersion": true
14+
},
15+
"plugins": {
16+
"@release-it-plugins/workspaces": {
17+
"skipChecks": true,
18+
"publish": false
19+
},
20+
"@release-it/conventional-changelog": {
21+
"preset": "angular",
22+
"infile": false
23+
}
24+
},
25+
"hooks": {
26+
"after:bump": "npx nx run-many --target=build --output-style=stream && npx nx run-many --target=publish --output-style=stream",
27+
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
28+
}
29+
}

lerna.json

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)