v1.0.0-rc4 #37
Workflow file for this run
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: Publish | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- published | |
jobs: | |
compile_core: | |
name: Compile Core | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: default | |
toolchain: 1.73.0 | |
target: wasm32-wasi | |
default: true | |
- name: Install wasi-sdk | |
run: make download-wasi-sdk | |
- name: Make core | |
run: make core | |
- name: Upload core binary to artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: engine | |
path: target/wasm32-wasi/release/js_pdk_core.wasm | |
compile_cli: | |
name: Compile CLI | |
needs: compile_core | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- name: linux | |
os: ubuntu-latest | |
path: target/x86_64-unknown-linux-gnu/release/extism-js | |
asset_name: extism-js-x86_64-linux-${{ github.event.release.tag_name }} | |
shasum_cmd: sha256sum | |
target: x86_64-unknown-linux-gnu | |
- name: linux-arm64 | |
os: ubuntu-latest | |
path: target/aarch64-unknown-linux-gnu/release/extism-js | |
asset_name: extism-js-aarch64-linux-${{ github.event.release.tag_name }} | |
shasum_cmd: sha256sum | |
target: aarch64-unknown-linux-gnu | |
- name: macos | |
os: macos-latest | |
path: target/x86_64-apple-darwin/release/extism-js | |
asset_name: extism-js-x86_64-macos-${{ github.event.release.tag_name }} | |
shasum_cmd: shasum -a 256 | |
target: x86_64-apple-darwin | |
- name: macos-arm64 | |
os: macos-latest | |
path: target/aarch64-apple-darwin/release/extism-js | |
asset_name: extism-js-aarch64-macos-${{ github.event.release.tag_name }} | |
shasum_cmd: shasum -a 256 | |
target: aarch64-apple-darwin | |
# - name: windows | |
# os: windows-latest | |
# path: target\release\extism-js.exe | |
# asset_name: extism-js-x86_64-windows-${{ github.event.release.tag_name }} | |
# shasum_cmd: sha256sum | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: engine | |
path: crates/cli/ | |
- name: ls | |
run: ls -R | |
working-directory: crates/cli/ | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: default | |
toolchain: 1.73.0 | |
target: ${{ matrix.target }} | |
default: true | |
- name: Install gnu gcc | |
run: | | |
sudo apt-get update | |
sudo apt-get install g++-aarch64-linux-gnu | |
sudo apt-get install gcc-aarch64-linux-gnu | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build CLI ${{ matrix.os }} | |
env: | |
EXTISM_ENGINE_PATH: js_pdk_core.wasm | |
run: cargo build --release --target ${{ matrix.target }} --package js-pdk-cli | |
- name: Archive assets | |
run: gzip -k -f ${{ matrix.path }} && mv ${{ matrix.path }}.gz ${{ matrix.asset_name }}.gz | |
- name: Upload assets to artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.asset_name }}.gz | |
path: ${{ matrix.asset_name }}.gz | |
- name: Upload assets to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./${{ matrix.asset_name }}.gz | |
asset_name: ${{ matrix.asset_name }}.gz | |
asset_content_type: application/gzip | |
- name: Generate asset hash | |
run: ${{ matrix.shasum_cmd }} ${{ matrix.asset_name }}.gz | awk '{ print $1 }' > ${{ matrix.asset_name }}.gz.sha256 | |
- name: Upload asset hash to artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.asset_name }}.gz.sha256 | |
path: ${{ matrix.asset_name }}.gz.sha256 | |
- name: Upload asset hash to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./${{ matrix.asset_name }}.gz.sha256 | |
asset_name: ${{ matrix.asset_name }}.gz.sha256 | |
asset_content_type: plain/text |