|
11 | 11 | description: |
12 | 12 | description: "Version description" |
13 | 13 | type: string |
14 | | - prerelease: |
15 | | - description: "Prerelease" |
16 | | - default: false |
17 | | - required: true |
18 | | - type: boolean |
19 | 14 |
|
20 | 15 | jobs: |
21 | 16 | release: |
@@ -60,17 +55,29 @@ jobs: |
60 | 55 | - name: bump package version |
61 | 56 | run: yarn version --no-git-tag-version --new-version ${{ github.event.inputs.version }} |
62 | 57 |
|
63 | | - - name: push new commit |
64 | | - uses: EndBug/add-and-commit@v7 |
65 | | - with: |
66 | | - add: package.json svg-only/dist action.yml |
67 | | - message: 📦 ${{ github.event.inputs.version }} |
68 | | - tag: v${{ github.event.inputs.version }} |
| 58 | + - name: push new build, tag version and push |
| 59 | + id: push-tags |
| 60 | + run: | |
| 61 | + VERSION=${{ github.event.inputs.version }} |
| 62 | +
|
| 63 | + git add package.json svg-only/dist action.yml |
| 64 | + git commit -m "📦 $VERSION" |
| 65 | + git tag v$VERSION |
| 66 | + git push origin master --tags |
| 67 | +
|
| 68 | + if [[ "$VERSION" =~ ^\d+\.\d+\.\d+$ ]] then |
| 69 | + git tag --force v$( echo VERSION | cut -d. -f 1-1 ) |
| 70 | + git tag --force v$( echo VERSION | cut -d. -f 1-2 ) |
| 71 | + git push origin --tags --force |
| 72 | + echo ::set-output name=prerelease::false |
| 73 | + else |
| 74 | + echo ::set-output name=prerelease::true |
| 75 | + fi |
69 | 76 |
|
70 | 77 | - uses: actions/create-release@v1 |
71 | 78 | env: |
72 | 79 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
73 | 80 | with: |
74 | 81 | tag_name: v${{ github.event.inputs.version }} |
75 | 82 | body: ${{ github.event.inputs.description }} |
76 | | - prerelease: ${{ github.event.inputs.prerelease }} |
| 83 | + prerelease: ${{ steps.push-tags.outputs.prerelease }} |
0 commit comments