Improve cicd build #44
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
name: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build_docker_images: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get Version | |
id: version | |
run: | | |
release=$(curl --silent -m 10 --connect-timeout 5 "https://api.github.com/repos/silence-laboratories/silent-shard-dkls23-ll/releases/latest") | |
tag=$(echo "$release" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') | |
tag=$(echo "$tag" | cut -c 2-) | |
echo "tag=$tag" >> $GITHUB_OUTPUT | |
# - name: build npm packages | |
# run: | | |
# curl --proto '=https' --tlsv1.2 -sySf https://sh.rustup.rs | sh | |
# rustup target add wasm32-unknown-unknown | |
# cargo install wasm-opt | |
# cargo install wasm-pack | |
# echo ${{ steps.version.outputs.tag }} | |
# ./ci/build-npm-packages.sh -v ${{ steps.version.outputs.tag }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
build-args: VER= ${{ steps.version.outputs.tag }} | |
load: true | |
tags: wasm-ll:latest | |
- uses: shrink/actions-docker-extract@v3 | |
id: extract | |
with: | |
image: wasm-ll:latest | |
path: pkg/* | |
destination: dist | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true | |
# docker build -t wasm-ll --build-arg VER=0.0.0 -f Dockerfile.wasm . | |