2424 registry-url : https://npm.pkg.github.com/
2525 scope : " @swagger-api"
2626
27- - name : Semantic Release
28- id : semantic
27+ - name : Determine the next release version
2928 uses : cycjimmy/semantic-release-action@v3
3029 with :
3130 dry_run : true
@@ -37,48 +36,57 @@ jobs:
3736 NPM_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
3837 NODE_AUTH_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
3938
40- - name : Next version
39+ - name : Nothing to release
40+ if : ${{ env.NEXT_RELEASE_VERSION == '' }}
41+ uses : actions/github-script@v6
42+ with :
43+ script : |
44+ core.setFailed('Nothing to release')
45+
46+ - name : Install dependencies
47+ run : npm ci
48+ env :
49+ NODE_AUTH_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
50+
51+ - name : Prepare for the Release
52+ env :
53+ REACT_APP_VERSION : ${{ env.NEXT_RELEASE_VERSION }}
54+ run : |
55+ npm run lint
56+ npm run test
57+ npm run build:app
58+ npm run cy:ci
59+ npm run build:bundle:esm
60+ npm run build:bundle:umd
61+
62+ - name : Semantic Release
63+ id : semantic
64+ uses : cycjimmy/semantic-release-action@v3
65+ with :
66+ dry_run : false
67+ extra_plugins : |
68+ @semantic-release/git
4169 env :
42- NEXT_RELEASE_VERSION : ${{ env.NEXT_RELEASE_VERSION }}
43- run : echo $NEXT_RELEASE_VERSION
70+ GITHUB_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
71+ NPM_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
72+ NODE_AUTH_TOKEN : ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
73+
74+ - name : Release failed
75+ if : steps.semantic.outputs.new_release_published == 'false'
76+ uses : actions/github-script@v6
77+ with :
78+ script : |
79+ core.setFailed('Release failed')
4480
45- # - name: Install dependencies
46- # run: npm ci
47- # env:
48- # NODE_AUTH_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
49- #
50- # - name: Prepare for the Release
51- # run: |
52- # npm run lint
53- # npm run test
54- # npm run build:app
55- # npm run cy:ci
56- # npm run build:bundle:esm
57- # npm run build:bundle:umd
58- #
59- # - name: Semantic Release
60- # id: semantic
61- # uses: cycjimmy/semantic-release-action@v3
62- # with:
63- # dry_run: false
64- # extra_plugins: |
65- # @semantic-release/git
66- # env:
67- # GITHUB_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
68- # NPM_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
69- # NODE_AUTH_TOKEN: ${{ secrets.SWAGGER_BOT_GITHUB_TOKEN }}
70- #
71- # - name: Release published
72- # if: steps.semantic.outputs.new_release_published == 'true'
73- # run: |
74- # echo ${{ steps.semantic.outputs.new_release_version }}
75- # echo ${{ steps.semantic.outputs.new_release_major_version }}
76- # echo ${{ steps.semantic.outputs.new_release_minor_version }}
77- # echo ${{ steps.semantic.outputs.new_release_patch_version }}
78- #
79- # - name: Release failed
80- # if: steps.semantic.outputs.new_release_published == 'false'
81- # uses: actions/github-script@v6
82- # with:
83- # script: |
84- # core.setFailed('Release failed')
81+ - name : Release published
82+ run : |
83+ echo ${{ steps.semantic.outputs.new_release_version }}
84+ echo ${{ steps.semantic.outputs.new_release_major_version }}
85+ echo ${{ steps.semantic.outputs.new_release_minor_version }}
86+ echo ${{ steps.semantic.outputs.new_release_patch_version }}
87+
88+ - name : Upload build artifacts
89+ uses : actions/upload-artifact@v3
90+ with :
91+ name : build
92+ path : ./build
0 commit comments