Skip to content

Build and Release

Build and Release #33

name: Build and Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"
rustc --version
cargo --version
- name: Install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
wasm-pack --version
- name: Install Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Build
run: |
deno run -Ar scripts/build.ts
- name: Typecheck
run: |
deno check src/**.ts
- name: Read version from release.json
id: read_version
run: |
sudo apt-get update -q
sudo apt-get install -y jq
echo "::set-output name=version::$(jq -r .version release.json)"
- name: Create a new tag
env:
RELEASE_VERSION: ${{ steps.read_version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "Rajdeep Malakar"
git config user.email "[email protected]"
git add -A
git commit -m "RELEASE $RELEASE_VERSION"
git tag $RELEASE_VERSION -m "Release $RELEASE_VERSION"
git push origin $RELEASE_VERSION