11name : Release
22on :
33 push :
4+ branches :
5+ - main
46 tags :
57 - " v*"
68 workflow_dispatch :
@@ -182,19 +184,19 @@ jobs:
182184 cd _dist
183185 tar czf py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz py2wasm.license py2wasm${{ matrix.config.extension }}
184186
187+ # Upload the build artifact so that we can later access it in the checksums job
185188 - name : Upload build artifact
186189 uses : actions/upload-artifact@v3
187190 with :
188191 name : py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
189192 path : _dist/py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
190193
191194 - name : upload binary to Github release
192- if : startsWith(github.ref, 'refs/tags/v')
193195 uses : svenstaro/upload-release-action@v2
194196 with :
195197 repo_token : ${{ secrets.GITHUB_TOKEN }}
196198 file : _dist/py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
197- tag : ${{ github.ref }}
199+ tag : ${{ env.RELEASE_VERSION }}
198200
199201 checksums :
200202 name : generate checksums
@@ -203,22 +205,19 @@ jobs:
203205 steps :
204206
205207 - name : set the release version (tag)
206- if : startsWith(github.ref, 'refs/tags/v')
207208 shell : bash
208209 run : echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
209210
210211 - name : download release assets
211212 uses : actions/download-artifact@v3
212213
213214 - name : generate checksums
214- run : |
215- ls -lh
216- sha256sum py2wasm*.tar.gz/py2wasm*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt
215+ run : sha256sum py2wasm*.tar.gz/py2wasm*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt
217216
218217 - name : upload checksums to Github release
219- if : startsWith(github.ref, 'refs/tags/v')
220218 uses : svenstaro/upload-release-action@v2
221219 with :
222220 repo_token : ${{ secrets.GITHUB_TOKEN }}
223221 file : checksums-${{ env.RELEASE_VERSION }}.txt
224- tag : ${{ github.ref }}
222+ tag : ${{ env.RELEASE_VERSION }}
223+
0 commit comments