|
9 | 9 | default: 'patch'
|
10 | 10 | type: choice
|
11 | 11 | options:
|
12 |
| - - patch |
13 |
| - - minor |
14 |
| - - major |
15 |
| - - prerelease |
16 |
| - - prepatch |
17 |
| - - preminor |
18 |
| - - premajor |
19 |
| - preId: |
20 |
| - description: 'Prerelease identifier (required with pre*)' |
21 |
| - required: false |
22 |
| - type: string |
| 12 | + - patch |
| 13 | + - minor |
| 14 | + - major |
| 15 | + - prerelease |
| 16 | + - prepatch |
| 17 | + - preminor |
| 18 | + - premajor |
| 19 | + # Uncomment the following for text input preId |
| 20 | + # preId: |
| 21 | + # description: 'Prerelease identifier (required with pre*)' |
| 22 | + # required: false |
| 23 | + # type: string |
| 24 | + # Uncomment the following for selection preId |
| 25 | + # preId: |
| 26 | + # description: 'Prerelease identifier (used with pre*)' |
| 27 | + # required: true |
| 28 | + # default: 'beta' |
| 29 | + # type: choice |
| 30 | + # options: |
| 31 | + # - alpha |
| 32 | + # - beta |
23 | 33 |
|
24 | 34 | jobs:
|
25 |
| - validate: |
26 |
| - name: Validate workflow inputs |
27 |
| - runs-on: ubuntu-latest |
| 35 | + # Uncomment the following step if using text input preId |
| 36 | + # validate: |
| 37 | + # name: Validate workflow inputs |
| 38 | + # runs-on: ubuntu-latest |
28 | 39 |
|
29 |
| - steps: |
30 |
| - - name: Invalid prerelease identifier |
31 |
| - if: ${{ startsWith(github.event.inputs.version, 'pre') && !github.event.inputs.preId }} |
32 |
| - run: | |
33 |
| - echo "Error: 'preId' input is required with 'pre-*' version." |
34 |
| - exit 1 |
| 40 | + # steps: |
| 41 | + # - name: Invalid prerelease identifier |
| 42 | + # if: ${{ startsWith(github.event.inputs.version, 'pre') && !github.event.inputs.preId }} |
| 43 | + # run: | |
| 44 | + # echo "Error: 'preId' input is required with 'pre-*' version." |
| 45 | + # exit 1 |
35 | 46 |
|
36 | 47 | version:
|
37 | 48 | name: Push ${{ inputs.version }} tag
|
38 | 49 | runs-on: ubuntu-latest
|
39 | 50 |
|
40 |
| - needs: [validate] |
| 51 | + # Uncomment the following line if using the validate step above |
| 52 | + # needs: [validate] |
41 | 53 |
|
42 | 54 | steps:
|
43 | 55 | - name: Checkout branch
|
|
56 | 68 | git config --global user.name "${{ github.actor }}"
|
57 | 69 | git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
58 | 70 | - name: NPM version
|
59 |
| - run: echo "version=$(npm version ${{ inputs.version }}${{ inputs.preId && format(' --preid {0}', inputs.preId) || '' }})" >> $GITHUB_ENV |
| 71 | + # Uncomment the following line if using preId input |
| 72 | + # run: echo "version=$(npm version ${{ inputs.version }}${{ startsWith(inputs.version, 'pre') && format(' --preid {0}', inputs.preId) || '' }})" >> "$GITHUB_ENV" |
| 73 | + # Uncomment the following line for hardcoded 'beta' preId |
| 74 | + run: echo "version=$(npm version ${{ inputs.version }})${{ startsWith(inputs.version, 'pre') && '--preid beta' || ''}}" >> "$GITHUB_ENV" |
60 | 75 | - name: Git push
|
61 | 76 | run: git push && git push origin ${{ env.version }}
|
0 commit comments