8
8
- main
9
9
10
10
jobs :
11
-
12
11
test_format :
13
12
runs-on : ubuntu-latest
14
13
if : ${{ !github.event.created && github.repository != 'garronej/ts-ci' }}
15
14
steps :
16
- - uses : actions/checkout@v3
17
- - uses : actions/setup-node@v3
18
- - uses : bahmutov/npm-install@v1
19
- - name : If this step fails run 'yarn format' then commit again.
20
- run : yarn format:check
15
+ - uses : actions/checkout@v5
16
+ - uses : actions/setup-node@v5
17
+ - uses : bahmutov/npm-install@v1
18
+ - name : If this step fails run 'yarn format' then commit again.
19
+ run : yarn format:check
21
20
test :
22
21
runs-on : ${{ matrix.os }}
23
22
needs : test_format
24
23
strategy :
25
24
matrix :
26
25
# node: [ '16', '17' ]
27
- node : [ '20' ]
26
+ node : ["22" ]
28
27
# os: [ windows-latest, ubuntu-latest ]
29
- os : [ ubuntu-latest ]
28
+ os : [ubuntu-latest]
30
29
name : Test with Node v${{ matrix.node }} on ${{ matrix.os }}
31
30
steps :
32
- - uses : actions/checkout@v3
33
- with :
34
- fetch-depth : 0
35
- - uses : actions/setup-node@v3
36
- with :
37
- node-version : ${{ matrix.node }}
38
- - uses : bahmutov/npm-install@v1
39
- - run : yarn build
40
- - run : yarn test
31
+ - uses : actions/checkout@v5
32
+ with :
33
+ fetch-depth : 0
34
+ - uses : actions/setup-node@v5
35
+ with :
36
+ node-version : ${{ matrix.node }}
37
+ - uses : bahmutov/npm-install@v1
38
+ - run : yarn build
39
+ - run : yarn test
41
40
42
41
deploy_storybook :
43
42
runs-on : ubuntu-latest
44
43
if : github.event_name == 'push'
45
44
needs : test
46
45
steps :
47
- - uses : actions/checkout@v3
48
- - uses : actions/setup-node@v3
49
- with :
50
- node-version : ' 18 '
51
- - uses : bahmutov/npm-install@v1
52
- - run : yarn build-storybook -o ./build_storybook
53
- - run : git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
54
- env :
55
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56
- -
run :
npx -y -p [email protected] gh-pages -d ./build_storybook -u "github-actions-bot <[email protected] >"
46
+ - uses : actions/checkout@v5
47
+ - uses : actions/setup-node@v5
48
+ with :
49
+ node-version : " 18 "
50
+ - uses : bahmutov/npm-install@v1
51
+ - run : yarn build-storybook -o ./build_storybook
52
+ - run : git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
53
+ env :
54
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55
+ -
run :
npx -y -p [email protected] gh-pages -d ./build_storybook -u "github-actions-bot <[email protected] >"
57
56
58
57
check_if_version_upgraded :
59
58
name : Check if version upgrade
64
63
# it's cleaner to stop the execution instead of letting the CI crash.
65
64
if : |
66
65
github.event_name == 'push' ||
67
- github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
66
+ github.event.pull_request.head.repo.owner.login == github.event.pull_request.base.repo.owner.login
68
67
runs-on : ubuntu-latest
69
68
needs : test
70
69
outputs :
@@ -73,10 +72,10 @@ jobs:
73
72
is_upgraded_version : ${{ steps.step1.outputs.is_upgraded_version }}
74
73
is_pre_release : ${{steps.step1.outputs.is_pre_release }}
75
74
steps :
76
- -
uses :
garronej/[email protected] .0
77
- id : step1
78
- with :
79
- action_name : is_package_json_version_upgraded
75
+ -
uses :
garronej/[email protected] .5
76
+ id : step1
77
+ with :
78
+ action_name : is_package_json_version_upgraded
80
79
81
80
create_github_release :
82
81
runs-on : ubuntu-latest
@@ -88,56 +87,56 @@ jobs:
88
87
github.event_name == 'push' ||
89
88
needs.check_if_version_upgraded.outputs.is_pre_release == 'true'
90
89
)
91
- needs :
90
+ needs :
92
91
- check_if_version_upgraded
93
92
steps :
94
- - uses : softprops/action-gh-release@v1
95
- with :
96
- name : Release v${{ needs.check_if_version_upgraded.outputs.to_version }}
97
- tag_name : v${{ needs.check_if_version_upgraded.outputs.to_version }}
98
- target_commitish : ${{ github.head_ref || github.ref }}
99
- generate_release_notes : true
100
- draft : false
101
- prerelease : ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }}
102
- env :
103
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
93
+ - uses : softprops/action-gh-release@v2
94
+ with :
95
+ name : Release v${{ needs.check_if_version_upgraded.outputs.to_version }}
96
+ tag_name : v${{ needs.check_if_version_upgraded.outputs.to_version }}
97
+ target_commitish : ${{ github.head_ref || github.ref }}
98
+ generate_release_notes : true
99
+ draft : false
100
+ prerelease : ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }}
101
+ env :
102
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104
103
105
104
publish_on_npm :
106
105
runs-on : ubuntu-latest
107
- needs :
106
+ needs :
108
107
- create_github_release
109
108
- check_if_version_upgraded
110
109
steps :
111
- - uses : actions/checkout@v3
112
- with :
113
- ref : ${{ github.ref }}
114
- - uses : actions/setup-node@v3
115
- with :
116
- registry-url : https://registry.npmjs.org/
117
- - uses : bahmutov/npm-install@v1
118
- - run : yarn build --prePublish
119
- -
run :
npx -y -p [email protected] enable_short_npm_import_path
120
- env :
121
- DRY_RUN : " 0"
122
- -
uses :
garronej/[email protected] .0
123
- with :
124
- action_name : remove_dark_mode_specific_images_from_readme
125
- - name : Publishing on NPM
126
- run : |
127
- if [ "$(npm show . version)" = "$VERSION" ]; then
128
- echo "This version is already published"
129
- exit 0
130
- fi
131
- if [ "$NODE_AUTH_TOKEN" = "" ]; then
132
- echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets"
133
- false
134
- fi
135
- EXTRA_ARGS=""
136
- if [ "$IS_PRE_RELEASE" = "true" ]; then
137
- EXTRA_ARGS="--tag next"
138
- fi
139
- npm publish $EXTRA_ARGS
140
- env :
141
- NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
142
- VERSION : ${{ needs.check_if_version_upgraded.outputs.to_version }}
143
- IS_PRE_RELEASE : ${{ needs.check_if_version_upgraded.outputs.is_pre_release }}
110
+ - uses : actions/checkout@v3
111
+ with :
112
+ ref : ${{ github.ref }}
113
+ - uses : actions/setup-node@v5
114
+ with :
115
+ registry-url : https://registry.npmjs.org/
116
+ - uses : bahmutov/npm-install@v1
117
+ - run : yarn build --prePublish
118
+ -
run :
npx -y -p [email protected] enable_short_npm_import_path
119
+ env :
120
+ DRY_RUN : " 0"
121
+ -
uses :
garronej/[email protected] .5
122
+ with :
123
+ action_name : remove_dark_mode_specific_images_from_readme
124
+ - name : Publishing on NPM
125
+ run : |
126
+ if [ "$(npm show . version)" = "$VERSION" ]; then
127
+ echo "This version is already published"
128
+ exit 0
129
+ fi
130
+ if [ "$NODE_AUTH_TOKEN" = "" ]; then
131
+ echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets"
132
+ false
133
+ fi
134
+ EXTRA_ARGS=""
135
+ if [ "$IS_PRE_RELEASE" = "true" ]; then
136
+ EXTRA_ARGS="--tag next"
137
+ fi
138
+ npm publish $EXTRA_ARGS
139
+ env :
140
+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
141
+ VERSION : ${{ needs.check_if_version_upgraded.outputs.to_version }}
142
+ IS_PRE_RELEASE : ${{ needs.check_if_version_upgraded.outputs.is_pre_release }}
0 commit comments