Skip to content

Commit e76da0a

Browse files
authored
Loc 673 update ci with changelogs and automatic releases (#3)
* 🔧 chore: Update release workflow * 🔧 chore: Update CI * 🔧 chore: Remove unused packaged * 🔧 chore: Add QA workflow * 🔧 chore: Update workflow runs-on * 🔧 chore: Add typedoc-plugin-missing-exports plugin
1 parent 16b175d commit e76da0a

File tree

5 files changed

+174
-3663
lines changed

5 files changed

+174
-3663
lines changed

.czrc

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

.github/workflows/qa.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: QA checks
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build package
11+
runs-on: [ self-hosted, Linux ]
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
21+
- name: Install dependencies
22+
run: npm ci --ignore-scripts
23+
24+
- name: Build package
25+
run: npm run build
26+
27+
lint:
28+
name: Lint source files
29+
runs-on: [ self-hosted, Linux ]
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Node
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 16
38+
39+
- name: Install dependencies
40+
run: npm ci --ignore-scripts
41+
42+
- name: Lint source files
43+
run: npm run lint
44+
45+
# test:
46+
# name: Run tests
47+
# runs-on: [ self-hosted, Linux ]
48+
# steps:
49+
# - name: Checkout repository
50+
# uses: actions/checkout@v4
51+
#
52+
# - name: Setup Node
53+
# uses: actions/setup-node@v3
54+
# with:
55+
# node-version: 16
56+
#
57+
# - name: Install dependencies
58+
# run: npm ci --ignore-scripts
59+
#
60+
# - name: Run tests
61+
# run: npm run test

.github/workflows/release.yml

Lines changed: 24 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Release CI
2+
13
on:
24
push:
35
branches:
@@ -7,97 +9,30 @@ permissions:
79
contents: write
810
pull-requests: write
911

10-
name: release
11-
12-
env:
13-
IS_MERGED_RELEASE_PR: ${{ startsWith(github.event.head_commit.message, '🚀 release:') }}
14-
1512
jobs:
16-
release:
17-
runs-on: ubuntu-latest
13+
prepare:
14+
name: Prepare Release
15+
if: github.event.head.ref != 'release' && !contains(github.event.commits[0].message, '🚀 release:')
16+
runs-on: [ self-hosted, Linux ]
1817
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Setup GIT
25-
uses: fregante/setup-git-user@v2
26-
27-
- name: Setup Node
28-
uses: actions/setup-node@v3
29-
with:
30-
node-version: 16
31-
registry-url: 'https://registry.npmjs.org'
32-
33-
- name: Install dependencies
34-
if: ${{ env.IS_MERGED_RELEASE_PR == 'false' }}
35-
run: npm ci --ignore-scripts
36-
37-
- name: Install dependencies and build package
38-
if: ${{ env.IS_MERGED_RELEASE_PR == 'true' }}
39-
run: npm ci
40-
41-
- name: Decide bump type
42-
if: ${{ env.IS_MERGED_RELEASE_PR == 'false' }}
43-
id: bump-type
44-
run: echo "bump=$(npx conventional-recommended-bump -p @localazy/conventional-changelog-preset)" > "$GITHUB_OUTPUT"
45-
46-
- name: Bump version
47-
if: ${{ env.IS_MERGED_RELEASE_PR == 'false' }}
48-
run: npm version ${{ steps.bump-type.outputs.bump }} --git-tag-version false
49-
50-
- name: Update changelog
51-
if: ${{ env.IS_MERGED_RELEASE_PR == 'false' }}
52-
run: npx conventional-changelog -p @localazy/preset -u -i CHANGELOG.md -s
53-
54-
- name: Preview changelog
55-
if: ${{ env.IS_MERGED_RELEASE_PR == 'false' }}
56-
id: preview-changelog
57-
run: |
58-
{
59-
echo 'changelog<<EOF'
60-
npx conventional-changelog -p @localazy/preset -u
61-
echo EOF
62-
} > "$GITHUB_OUTPUT"
63-
64-
- name: Read package.json version
65-
id: package-version
66-
uses: martinbeentjes/npm-get-version-action@v1.3.1
67-
68-
- name: Create release PR
69-
if: ${{ env.IS_MERGED_RELEASE_PR == 'false' }}
70-
uses: peter-evans/create-pull-request@v5
18+
- name: Prepare release branch and PR
19+
uses: localazy/release@v1
7120
with:
72-
branch: "release"
73-
commit-message: "🚀 release: ${{ steps.package-version.outputs.current-version }}"
74-
delete-branch: true
75-
labels: release-preview
76-
title: ${{ steps.package-version.outputs.current-version }}
77-
body: ${{ steps.preview-changelog.outputs.changelog }}
78-
79-
- name: Read changelog
80-
if: ${{ env.IS_MERGED_RELEASE_PR == 'true' }}
81-
id: read-changelog
82-
run: |
83-
{
84-
echo 'changelog<<EOF'
85-
npx conventional-changelog -p @localazy/preset -r 1
86-
echo EOF
87-
} > "$GITHUB_OUTPUT"
21+
action: prepare
22+
app-id: ${{ secrets.AUTH_APP_ID }}
23+
app-key: ${{ secrets.AUTH_APP_KEY }}
8824

89-
- name: Git tag, GitHub release
90-
if: ${{ env.IS_MERGED_RELEASE_PR == 'true' }}
91-
uses: avakar/tag-and-release@v1
25+
release:
26+
name: Release
27+
if: github.event.head.ref == 'release' || contains(github.event.commits[0].message, '🚀 release:')
28+
runs-on: [ self-hosted, Linux ]
29+
steps:
30+
- name: Release new version
31+
uses: localazy/release@v1
9232
with:
93-
tag_name: ${{ steps.package-version.outputs.current-version }}
94-
release_name: ${{ steps.package-version.outputs.current-version }}
95-
body: ${{ steps.read-changelog.outputs.changelog }}
96-
env:
97-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-
99-
# - name: Publish NPM package
100-
# if: ${{ env.IS_MERGED_RELEASE_PR == 'true' }}
101-
# run: npm publish
102-
# env:
103-
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
action: release
34+
app-id: ${{ secrets.AUTH_APP_ID }}
35+
app-key: ${{ secrets.AUTH_APP_KEY }}
36+
npm-publish: true
37+
npm-access: true
38+
npm-token: ${{ secrets.NPM_AUTH_TOKEN }}

0 commit comments

Comments
 (0)