11name : Release
22on :
33 push :
4+ branches :
5+ - main
46 tags :
57 - " v*"
68 workflow_dispatch :
@@ -171,19 +173,19 @@ jobs:
171173 cd _dist
172174 tar czf py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz py2wasm.license py2wasm${{ matrix.config.extension }}
173175
176+ # Upload the build artifact so that we can later access it in the checksums job
174177 - name : Upload build artifact
175178 uses : actions/upload-artifact@v3
176179 with :
177180 name : py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
178181 path : _dist/py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
179182
180183 - name : upload binary to Github release
181- if : startsWith(github.ref, 'refs/tags/v')
182184 uses : svenstaro/upload-release-action@v2
183185 with :
184186 repo_token : ${{ secrets.GITHUB_TOKEN }}
185187 file : _dist/py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
186- tag : ${{ github.ref }}
188+ tag : ${{ env.RELEASE_VERSION }}
187189
188190 checksums :
189191 name : generate checksums
@@ -196,18 +198,21 @@ jobs:
196198 shell : bash
197199 run : echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
198200
201+ - name : set the release version (main)
202+ if : github.ref == 'refs/heads/main'
203+ shell : bash
204+ run : echo "RELEASE_VERSION=canary" >> $GITHUB_ENV
205+
199206 - name : download release assets
200207 uses : actions/download-artifact@v3
201208
202209 - name : generate checksums
203- run : |
204- ls -lh
205- sha256sum py2wasm*.tar.gz/py2wasm*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt
210+ run : sha256sum py2wasm*.tar.gz/py2wasm*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt
206211
207212 - name : upload checksums to Github release
208- if : startsWith(github.ref, 'refs/tags/v')
209213 uses : svenstaro/upload-release-action@v2
210214 with :
211215 repo_token : ${{ secrets.GITHUB_TOKEN }}
212216 file : checksums-${{ env.RELEASE_VERSION }}.txt
213- tag : ${{ github.ref }}
217+ tag : ${{ env.RELEASE_VERSION }}
218+
0 commit comments