@@ -11,17 +11,92 @@ jobs:
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
41+
2342 - name : Deploy demo
2443 uses : peaceiris/actions-gh-pages@v3
2544 with :
2645 github_token : ${{ secrets.GITHUB_TOKEN }}
2746 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
59+ with :
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 }}
0 commit comments