Skip to content

Commit bba8499

Browse files
feat(ref: no-ref): update version,remove husky
1 parent 486785d commit bba8499

File tree

20 files changed

+7711
-5101
lines changed

20 files changed

+7711
-5101
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin
2+
3+
set -e
4+
5+
npm run lint
6+
7+
output=$(npm run type-coverage)
8+
if echo "$output" | grep -q "lower than "; then
9+
echo "$output"
10+
exit 1 # Terminate the hook script with a non-zero exit code
11+
else
12+
echo "Type coverage is good! 🎉"
13+
fi
14+
15+
npm run test
16+
17+
npm run build
18+
19+
npm run build:lib

.github/workflows/gh-pages.yml

Lines changed: 85 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,100 @@ name: GitHub pages
33
on:
44
push:
55
branches:
6-
- develop
6+
- feat/update-version
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
permissions:
1212
contents: write
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
1617
with:
17-
node-version: 18
18-
- name: Build demo
18+
node-version: 20
19+
20+
- name: Install deps
1921
run: |
2022
npm ci --force
21-
git submodule update --init --recursive --remote
23+
git submodule update --init --recursive --remote
24+
25+
- name: Semantic Release
26+
id: semantic-release
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
npx semantic-release
31+
32+
- name: Build demo app
33+
env:
34+
RELEASE_VERSION: ${{ steps.semantic-release.outputs.new-release-version }}
35+
run: |
36+
echo '********'
37+
echo "RELEASE_VERSION: $RELEASE_VERSION"
38+
echo '********'
39+
bash .github/workflows/scripts/replace_template.sh $RELEASE_VERSION
2240
npm run build
23-
- name: Deploy demo
24-
uses: peaceiris/actions-gh-pages@v3
41+
42+
# - name: Deploy demo
43+
# uses: peaceiris/actions-gh-pages@v3
44+
# with:
45+
# github_token: ${{ secrets.GITHUB_TOKEN }}
46+
# publish_dir: ./dist/angular-loader/browser
47+
48+
outputs:
49+
version: ${{ steps.semantic-release.outputs.new-release-version }}
50+
51+
slack_notification:
52+
needs:
53+
- build
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Post to a Slack channel
57+
id: slack
58+
uses: slackapi/slack-github-action@v1.25.0
2559
with:
26-
github_token: ${{ secrets.GITHUB_TOKEN }}
27-
publish_dir: ./dist/angular-loader/browser
60+
channel-id: 'deployments'
61+
payload: |
62+
{
63+
"blocks": [
64+
{
65+
"type": "section",
66+
"text": {
67+
"type": "mrkdwn",
68+
"text": "GitHub Action build result: ${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
69+
}
70+
},
71+
{
72+
"type": "section",
73+
"text": {
74+
"type": "mrkdwn",
75+
"text": "Project: `${{ github.event.repository.name }}`"
76+
}
77+
},
78+
{
79+
"type": "section",
80+
"text": {
81+
"type": "mrkdwn",
82+
"text": "Version: `${{ needs.build.outputs.version || 'TBA' }}`"
83+
}
84+
},
85+
{
86+
"type": "section",
87+
"text": {
88+
"type": "mrkdwn",
89+
"text": "Commit/PR URL: ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
90+
}
91+
},
92+
{
93+
"type": "section",
94+
"text": {
95+
"type": "mrkdwn",
96+
"text": "Website URL: ${{ secrets.WEBSITE_URL || 'TBA' }}"
97+
}
98+
}
99+
]
100+
}
101+
env:
102+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin
2+
3+
set -e
4+
5+
npm run lint
6+
7+
output=$(npm run type-coverage)
8+
if echo "$output" | grep -q "lower than "; then
9+
echo "$output"
10+
exit 1 # Terminate the hook script with a non-zero exit code
11+
else
12+
echo "Type coverage is good! 🎉"
13+
fi
14+
15+
npm run test
16+
17+
npm run build
18+
19+
npm run build:lib
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Check if the correct number of arguments are provided
4+
if [ $# -ne 1 ]; then
5+
echo "Usage: $0 <version>"
6+
exit 1
7+
fi
8+
9+
# Assign arguments to variables
10+
custom_string="$1"
11+
12+
# Perform the replacement and save to output file
13+
sed "s/<%version%>/$custom_string/g" "angular.json" > "angular.json.tmp" && mv "angular.json.tmp" "angular.json"
14+
15+
echo "Template string replaced successfully. 🎉"

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/commit-msg

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

.husky/pre-commit

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

.releaserc.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
branches:
2+
- feat/update-version
3+
4+
plugins:
5+
- '@semantic-release/commit-analyzer'
6+
- '@semantic-release/github'
7+
- 'semantic-release-export-data'

angular.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
"outputPath": "dist/angular-loader",
2727
"browser": "src/main.ts",
2828
"index": "src/index.html",
29-
"polyfills": [
30-
"zone.js"
31-
],
3229
"tsConfig": "src/tsconfig.app.json",
3330
"assets": ["src/favicon.ico", "src/assets"],
3431
"styles": [
@@ -43,6 +40,9 @@
4340
},
4441
"configurations": {
4542
"production": {
43+
"define": {
44+
"VERSION": "'<%version%>'"
45+
},
4646
"optimization": true,
4747
"sourceMap": false,
4848
"namedChunks": false,
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"type": "anyComponentStyle",
58-
"maximumWarning": "2kb",
58+
"maximumWarning": "9kb",
5959
"maximumError": "10kb"
6060
}
6161
],
@@ -67,6 +67,9 @@
6767
]
6868
},
6969
"development": {
70+
"define": {
71+
"VERSION": "'v0.0.1'"
72+
},
7073
"optimization": false,
7174
"extractLicenses": false,
7275
"sourceMap": true

0 commit comments

Comments
 (0)