File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 3232 - run : npm ci
3333 - run : npm run build --if-present
3434
35+ - name : tag
36+ id : tag
37+ run : |
38+ node ./scripts/tag.js ${{ github.event.release.tag_name }}
39+
40+
3541 - name : publish
3642 run : |
37- npm version --no-git-tag-version --yes --exact ${{ steps.timestamp.outputs.stamp }}
43+ npm version --no-git-tag-version --yes --exact ${{ github.event.release.tag_name }}
3844 npm publish --access public --provenance ${{ steps.tag.outputs.tag }} 2>&1
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+ /*
3+ * Licensed under the Apache License, Version 2.0 (the "License");
4+ * you may not use this file except in compliance with the License.
5+ * You may obtain a copy of the License at
6+ *
7+ * http://www.apache.org/licenses/LICENSE-2.0
8+ *
9+ * Unless required by applicable law or agreed to in writing, software
10+ * distributed under the License is distributed on an "AS IS" BASIS,
11+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ * See the License for the specific language governing permissions and
13+ * limitations under the License.
14+ */
15+
16+ 'use strict' ;
17+
18+ const semver = require ( 'semver' ) ;
19+ const targetVersion = process . argv [ 2 ] ;
20+
21+ if ( ! semver . valid ( targetVersion ) ) {
22+ console . error ( `Error: the version "${ targetVersion } " is invalid!` ) ;
23+ process . exit ( 1 ) ;
24+ }
25+
26+ const prerelease = semver . prerelease ( targetVersion ) ;
27+ const tag = prerelease ? 'unstable' : 'latest' ;
28+
29+ console . log ( `::set-output name=tag::--tag=${ tag } ` ) ;
You can’t perform that action at this time.
0 commit comments