release-otoroshi-plugin-dynamic-js-modules #6
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: release-otoroshi-plugin-dynamic-js-modules | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version number" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup jdk11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: install extism js pdk | |
run: | | |
curl -O https://raw.githubusercontent.com/extism/js-pdk/main/install.sh | |
sh install.sh | |
- uses: coursier/cache-action@v5 | |
- name: build-runtime | |
id: build-runtime | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
sh ./build-js-runtime.sh | |
- name: change version | |
run: | | |
echo 'ThisBuild / version := "${{ inputs.version }}"' > version.sbt | |
- name: build-libs | |
id: build-libs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
sbt ';compile;package' | |
- name: Generate SHA-256 | |
run: | | |
shasum -a 256 ./target/scala-2.12/otoroshi-plugin-dynamic-js-modules_2.12-${{ inputs.version }}.jar | cut -d ' ' -f 1 > ./target/scala-2.12/otoroshi-plugin-dynamic-js-modules_2.12-${{ inputs.version }}.jar.sha256 | |
shasum -a 256 ./src/main/resources/wasm/otoroshi-plugin-dynamic-js-modules-runtime.wasm | cut -d ' ' -f 1 > ./src/main/resources/wasm/otoroshi-plugin-dynamic-js-modules-runtime.wasm.sha256 | |
- name: Release binary and SHA-256 checksum to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ inputs.version }} | |
files: | | |
./target/scala-2.12/otoroshi-plugin-dynamic-js-modules_2.12-${{ inputs.version }}.jar | |
./target/scala-2.12/otoroshi-plugin-dynamic-js-modules_2.12-${{ inputs.version }}.jar.sha256 | |
./src/main/resources/wasm/otoroshi-plugin-dynamic-js-modules-runtime.wasm | |
./src/main/resources/wasm/otoroshi-plugin-dynamic-js-modules-runtime.wasm.sha256 |