|
13 | 13 | description: 'pre-release' |
14 | 14 | required: false |
15 | 15 | default: false |
| 16 | + snapshot: |
| 17 | + type: boolean |
| 18 | + description: 'Release as snapshot. This setting has precedence over all other inputs.' |
| 19 | + required: false |
| 20 | + default: false |
16 | 21 |
|
17 | 22 | jobs: |
18 | 23 | build: |
@@ -51,11 +56,26 @@ jobs: |
51 | 56 | npm install -g npm |
52 | 57 | yarn install --immutable |
53 | 58 |
|
54 | | - - name: version |
| 59 | + - name: version - Release |
| 60 | + if: ${{ github.event.inputs.snapshot == 'false' }} |
55 | 61 | run: | |
56 | 62 | ${GITHUB_WORKSPACE}/node_modules/.bin/lerna version ${{ github.event.inputs.release_type }} \ |
57 | 63 | ${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \ |
58 | | - --no-git-tag-version --no-push |
| 64 | + --no-push \ |
| 65 | + --no-git-tag-version |
| 66 | +
|
| 67 | + - name: version - Snapshot |
| 68 | + if: ${{ github.event.inputs.snapshot == 'true' }} |
| 69 | + run: | |
| 70 | + git_hash=$(git rev-parse --short "${{ github.sha }}") |
| 71 | + |
| 72 | + ${GITHUB_WORKSPACE}/node_modules/.bin/lerna version "0.0.0-${git_hash}" \ |
| 73 | + --exact \ |
| 74 | + --no-push \ |
| 75 | + --no-git-tag-version \ |
| 76 | + --allow-branch ${{ github.ref_name }} |
| 77 | + |
| 78 | + |
59 | 79 |
|
60 | 80 | build-and-release: |
61 | 81 | needs: ['test', 'release-dryrun', 'check-charts-compat-peer-deps'] |
@@ -84,34 +104,44 @@ jobs: |
84 | 104 | npm install -g npm |
85 | 105 | yarn install --immutable |
86 | 106 |
|
87 | | - - name: version |
| 107 | + - name: Setup Git User |
88 | 108 | run: | |
89 | | - npm config set //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} |
90 | | -
|
91 | 109 | git config user.email ${{ secrets.BOT_GIT_EMAIL }} |
92 | 110 | git config user.name ${{ secrets.BOT_GIT_USERNAME }} |
93 | 111 |
|
| 112 | + - name: version - Release |
| 113 | + if: ${{ github.event.inputs.snapshot == 'false' }} |
| 114 | + run: | |
94 | 115 | ${GITHUB_WORKSPACE}/node_modules/.bin/lerna version ${{ github.event.inputs.release_type }} \ |
95 | 116 | ${{ (github.event.inputs.prerelease == 'true' && '--conventional-prerelease') || '--conventional-graduate' }} \ |
96 | 117 | --create-release github |
97 | 118 | env: |
98 | 119 | GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} |
99 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
100 | | - NPM_CONFIG_PROVENANCE: true |
| 120 | + |
| 121 | + - name: version - Snapshot |
| 122 | + if: ${{ github.event.inputs.snapshot == 'true' }} |
| 123 | + run: | |
| 124 | + git_hash=$(git rev-parse --short "${{ github.sha }}") |
| 125 | + |
| 126 | + ${GITHUB_WORKSPACE}/node_modules/.bin/lerna version "0.0.0-${git_hash}" \ |
| 127 | + --exact \ |
| 128 | + --no-push \ |
| 129 | + --allow-branch ${{ github.ref_name }} |
101 | 130 |
|
102 | 131 | - name: build |
103 | 132 | run: yarn build |
104 | 133 |
|
105 | 134 | - name: publish to npm |
106 | | - run: ${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-git |
| 135 | + run: | |
| 136 | + ${GITHUB_WORKSPACE}/node_modules/.bin/lerna publish from-git ${{ github.event.inputs.snapshot == 'true' && '--pre-dist-tag dev' }} |
107 | 137 | env: |
108 | 138 | GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} |
109 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} |
110 | 139 | NPM_CONFIG_PROVENANCE: true |
111 | 140 |
|
112 | 141 | ### Semantic Release Bot comments for issues and PRs ### |
113 | 142 | - name: Add release comments to issues and PRs |
114 | 143 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
| 144 | + if: ${{ github.event.inputs.snapshot == 'false' }} |
115 | 145 | env: |
116 | 146 | GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} |
117 | 147 | with: |
|
0 commit comments