Skip to content

Commit

Permalink
Merge pull request #40 from fermyon/canary-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev authored Jul 6, 2023
2 parents 71107c9 + c70e2c0 commit 188fe6b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release
on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:
Expand Down Expand Up @@ -171,19 +173,19 @@ jobs:
cd _dist
tar czf py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz py2wasm.license py2wasm${{ matrix.config.extension }}
# Upload the build artifact so that we can later access it in the checksums job
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
path: _dist/py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz

- name: upload binary to Github release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: _dist/py2wasm-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz
tag: ${{ github.ref }}
tag: ${{ env.RELEASE_VERSION }}

checksums:
name: generate checksums
Expand All @@ -196,18 +198,21 @@ jobs:
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: set the release version (main)
if: github.ref == 'refs/heads/main'
shell: bash
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV

- name: download release assets
uses: actions/download-artifact@v3

- name: generate checksums
run: |
ls -lh
sha256sum py2wasm*.tar.gz/py2wasm*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt
run: sha256sum py2wasm*.tar.gz/py2wasm*.tar.gz > checksums-${{ env.RELEASE_VERSION }}.txt

- name: upload checksums to Github release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: checksums-${{ env.RELEASE_VERSION }}.txt
tag: ${{ github.ref }}
tag: ${{ env.RELEASE_VERSION }}

0 comments on commit 188fe6b

Please sign in to comment.