Skip to content

Commit

Permalink
Merge pull request #2 from LTLA/main
Browse files Browse the repository at this point in the history
Automatically build and release upon push of a new tag.
  • Loading branch information
bmaranville authored Dec 13, 2022
2 parents 34de5e7 + c0d9a31 commit 63fe8cb
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
push:
tags:
- 'v*'

name: Build HDF5 Wasm

jobs:
build-wasm:
runs-on: ubuntu-latest
container: ghcr.io/ltla/emcmake-docker/builder:2022-12-13

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Fetch release name
run: |
release=${GITHUB_REF#refs/*/}
echo "RELEASE=${release}" >> $GITHUB_ENV
emsdk=$(echo ${release} | sed "s/^v[^_]*_//")
echo "EMSDK_VERSION=${emsdk}" >> $GITHUB_ENV
prefix=$(echo ${release} | sed "s/_.*//")
title="${prefix} (Emscripten ${emsdk})"
echo "TITLE=${title}" >> $GITHUB_ENV
echo $title
- name: Activate Emscripten version
run: |
cd /emsdk && git pull
emsdk install ${{ env.EMSDK_VERSION }}
emsdk activate ${{ env.EMSDK_VERSION }}
- name: Build library
run: make all

- name: Package builds
run: make release

- name: Prettify release body
run: |
echo "Built with:" > release.txt
echo "- "$(cmake --version | head -1) >> release.txt
echo "- "$(emcc -v 2>&1 | head -1) >> release.txt
echo "" >> release.txt
echo "File SHA256:" >> release.txt
echo \`\`\` >> release.txt
for x in $(ls libhdf5-*-wasm.tar.gz)
do
shasum -a 256 $x >> release.txt
done
echo \`\`\` >> release.txt
cat release.txt
- name: Publish tarballs
uses: softprops/action-gh-release@v1
with:
files: libhdf5-*-wasm.tar.gz
name: ${{ env.TITLE }}
body_path: release.txt

0 comments on commit 63fe8cb

Please sign in to comment.