Skip to content

Continuous Deployment #3

Continuous Deployment

Continuous Deployment #3

Workflow file for this run

name: Continuous Deployment
on:
release:
types: [created]
env:
CARGO_TERM_COLOR: always
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Setup | Rust
uses: dtolnay/rust-toolchain@v1
with:
target: wasm32-unknown-unknown
components: clippy, rustfmt
toolchain: stable
- name: Check out repository
uses: actions/checkout@v3
- name: Build | Fmt Check
run: cargo fmt -- --check
- name: Build | Clippy
run: cargo clippy --no-deps
- name: Build | Compile
run: cargo build --release
- name: Build | Copy dist files
run: |
mkdir -p chip
cp target/wasm32-unknown-unknown/release/shtc3.wasm chip/chip.wasm
cp wokwi-chip.json chip/chip.json
- name: Create chip.version.txt file
run: echo "$ZIP_VERSION" > chip/chip.version.txt
env:
ZIP_VERSION: ${{ github.ref_name }}
- name: Create a zip archive
run: cd chip && zip -9 ../chip.zip chip.*
- name: Upload compressed artifact
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: chip.zip
tag: ${{ github.ref }}