|
54 | 54 | - name: Checkout |
55 | 55 | uses: actions/checkout@v4 |
56 | 56 |
|
| 57 | + - name: Set up Git |
| 58 | + shell: bash |
| 59 | + run: | |
| 60 | + git config user.email "github@action.com" |
| 61 | + git config user.name "Github Action" |
| 62 | + echo ${{ secrets.GITHUB_TOKEN }} > token.txt |
| 63 | + git config credential.helper "store --file=token.txt" |
| 64 | +
|
| 65 | + - name: Update version |
| 66 | + shell: bash |
| 67 | + run: | |
| 68 | + echo NEW_VERSION=$(yarn version --${{ inputs.version_increment }} --json | jq -r '.data | select(contains("New version")) | split(":")[1] | gsub(" ";"")') >> $GITHUB_ENV |
| 69 | + env: |
| 70 | + REF: ${{ github.ref }} |
| 71 | + |
| 72 | + - name: Push to unprotected branch |
| 73 | + if: inputs.is_branch_protected == 'false' |
| 74 | + shell: bash |
| 75 | + run: | |
| 76 | + git push --follow-tags |
| 77 | + env: |
| 78 | + REF: ${{ github.ref }} |
| 79 | + |
| 80 | + - name: Push to protected branch |
| 81 | + if: inputs.is_branch_protected == 'true' |
| 82 | + uses: CasperWA/push-protected@v2 |
| 83 | + with: |
| 84 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 85 | + branch: main |
| 86 | + unprotect_reviews: true |
| 87 | + tags: true |
| 88 | + |
| 89 | + - name: Publish release |
| 90 | + uses: ncipollo/release-action@v1 |
| 91 | + with: |
| 92 | + name: Release ${{ env.NEW_VERSION }} |
| 93 | + commit: ${{ env.REF }} |
| 94 | + draft: false |
| 95 | + prerelease: false |
| 96 | + generateReleaseNotes: true |
| 97 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + makeLatest: ${{ inputs.latest }} |
| 99 | + tag: ${{ env.NEW_VERSION }} |
| 100 | + |
57 | 101 | - name: Use Node.js |
58 | 102 | uses: actions/setup-node@v4 |
59 | 103 | with: |
@@ -103,42 +147,6 @@ jobs: |
103 | 147 | arch: 'amd64' |
104 | 148 | desc: 'Sesame Daemon' |
105 | 149 |
|
106 | | - - name: Update version |
107 | | - shell: bash |
108 | | - run: | |
109 | | - echo NEW_VERSION=$(yarn version --${{ inputs.version_increment }} --json | jq -r '.data | select(contains("New version")) | split(":")[1] | gsub(" ";"")') >> $GITHUB_ENV |
110 | | - env: |
111 | | - REF: ${{ github.ref }} |
112 | | - |
113 | | - - name: Push to unprotected branch |
114 | | - if: inputs.is_branch_protected == 'false' |
115 | | - shell: bash |
116 | | - run: | |
117 | | - git push --follow-tags |
118 | | - env: |
119 | | - REF: ${{ github.ref }} |
120 | | - |
121 | | - - name: Push to protected branch |
122 | | - if: inputs.is_branch_protected == 'true' |
123 | | - uses: CasperWA/push-protected@v2 |
124 | | - with: |
125 | | - token: ${{ secrets.GITHUB_TOKEN }} |
126 | | - branch: main |
127 | | - unprotect_reviews: true |
128 | | - tags: true |
129 | | - |
130 | | - - name: Publish release |
131 | | - uses: ncipollo/release-action@v1 |
132 | | - with: |
133 | | - name: Release ${{ env.NEW_VERSION }} |
134 | | - commit: ${{ env.REF }} |
135 | | - draft: false |
136 | | - prerelease: false |
137 | | - generateReleaseNotes: true |
138 | | - token: ${{ secrets.GITHUB_TOKEN }} |
139 | | - makeLatest: ${{ inputs.latest }} |
140 | | - tag: ${{ env.NEW_VERSION }} |
141 | | - |
142 | 150 | - name: Release |
143 | 151 | uses: svenstaro/upload-release-action@v2 |
144 | 152 | with: |
|
0 commit comments