Build and Release #36
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: 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 task build --bypass-pkg-check --bypass-rs-check | |
- name: Typecheck | |
run: | | |
deno check src/**.ts | |
- name: Test | |
run: | | |
deno task test | |
- 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 add pkg -f | |
git commit -m "RELEASE $RELEASE_VERSION" | |
git tag $RELEASE_VERSION -m "Release $RELEASE_VERSION" | |
git push origin $RELEASE_VERSION |