Skip to content

Commit

Permalink
ci: release share directory with extism-py executable
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Sep 25, 2024
1 parent 36a46f4 commit 05e0a55
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ jobs:
name: engine
path: lib/target/wasm32-wasi/release/core.wasm

- name: Upload wasi-deps
uses: actions/upload-artifact@v4
with:
name: wasi-deps
path: lib/target/wasm32-wasi/wasi-deps

compile_cli:
name: Compile CLI
needs: compile_core
Expand Down Expand Up @@ -95,6 +101,10 @@ jobs:
name: engine
path: bin

- uses: actions/download-artifact@v4
with:
name: wasi-deps

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -121,46 +131,46 @@ jobs:
run: cd bin && cargo build --release --target ${{ matrix.target }} --package extism-py

- name: Archive assets
run: gzip -k -f ${{ matrix.path }} && mv ${{ matrix.path }}.gz ${{ matrix.asset_name }}.gz
run: mv wasi-deps/usr share && tar czf ${{ matrix.asset_name }}.tar.gz ${{ matrix.path }} share

- name: Upload assets to artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}.gz
path: ${{ matrix.asset_name }}.gz
name: ${{ matrix.asset_name }}.tar.gz
path: ${{ matrix.asset_name }}.tar.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_path: ./${{ matrix.asset_name }}.tar.gz
asset_name: ${{ matrix.asset_name }}.tar.gz
asset_content_type: application/gzip

- name: Generate asset hash (Linux/MacOS)
run: ${{ matrix.shasum_cmd }} ${{ matrix.asset_name }}.gz | awk '{ print $1 }' > ${{ matrix.asset_name }}.gz.sha256
run: ${{ matrix.shasum_cmd }} ${{ matrix.asset_name }}.tar.gz | awk '{ print $1 }' > ${{ matrix.asset_name }}.tar.gz.sha256
if: runner.os != 'Windows'

- name: Generate asset hash (Windows)
run: Get-FileHash -Path ${{ matrix.asset_name }}.gz -Algorithm SHA256 | Select-Object -ExpandProperty Hash > ${{ matrix.asset_name }}.gz.sha256
run: Get-FileHash -Path ${{ matrix.asset_name }}.tar.gz -Algorithm SHA256 | Select-Object -ExpandProperty Hash > ${{ matrix.asset_name }}.tar.gz.sha256
shell: pwsh
if: runner.os == 'Windows'

- name: Upload asset hash to artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}.gz.sha256
path: ${{ matrix.asset_name }}.gz.sha256
name: ${{ matrix.asset_name }}.tar.gz.sha256
path: ${{ matrix.asset_name }}.tar.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_path: ./${{ matrix.asset_name }}.tar.gz.sha256
asset_name: ${{ matrix.asset_name }}.tar.gz.sha256
asset_content_type: plain/text

0 comments on commit 05e0a55

Please sign in to comment.