-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from LTLA/main
Automatically build and release upon push of a new tag.
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |