Skip to content

Commit 30f6e9d

Browse files
committed
ci: add prebuild workflow
For #186.
1 parent b65639a commit 30f6e9d

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed

.github/workflows/prebuild.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
name: Prebuild
3+
description: Pre-Build WASM Binaries
4+
5+
# yamllint disable-line rule:truthy
6+
on:
7+
workflow_dispatch:
8+
9+
permissions:
10+
attestations: write
11+
contents: write
12+
id-token: write
13+
14+
env:
15+
# Disable incremental compilation to avoid overhead.
16+
CARGO_INCREMENTAL: "0"
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
# do NOT load any caches here, we want a clean, freestanding build w/o stateful dependencies!
23+
24+
- name: Set Timestamp
25+
id: timestamp
26+
run: echo "::set-output name=timestamp::$(date +%s)"
27+
28+
- name: Checkout
29+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Free disk space
34+
uses: ./.github/actions/free-disk-space
35+
36+
- name: Fetch main branch
37+
run: git fetch --depth=1 origin main
38+
39+
- name: Install `just`
40+
uses: taiki-e/install-action@763e3324d4fd026c9bd284c504378585777a87d5 # v2
41+
with:
42+
tool: just
43+
44+
- name: Install stable toolchain
45+
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
46+
with:
47+
components: clippy, rustfmt
48+
toolchain: stable
49+
targets: wasm32-wasip2
50+
51+
- name: build "add one" example (debug)
52+
run: just guests::rust::build-add-one-debug
53+
54+
- name: build "add one" example (release)
55+
run: just guests::rust::build-add-one-release
56+
57+
- name: build python guest (debug)
58+
run: just guests::python::build-debug
59+
60+
- name: build python guest (release)
61+
run: just guests::python::build-release
62+
63+
- name: attestation
64+
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a #v3
65+
with:
66+
subject-path: |
67+
target/wasm32-wasip2/debug/examples/add_one.wasm
68+
target/wasm32-wasip2/release/examples/add_one.wasm
69+
target/wasm32-wasip2/debug/datafusion_udf_wasm_python.wasm
70+
target/wasm32-wasip2/release/datafusion_udf_wasm_python.wasm
71+
72+
- name: publish release
73+
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2
74+
with:
75+
body: |
76+
WASM binaries for [`${{ github.sha }}`](${{ github.server_url }}/${{ github.repository }}/tree/${{ github.sha }}).
77+
preserve_order: true
78+
files: |
79+
target/wasm32-wasip2/debug/examples/add_one.wasm
80+
target/wasm32-wasip2/release/examples/add_one.wasm
81+
target/wasm32-wasip2/debug/datafusion_udf_wasm_python.wasm
82+
target/wasm32-wasip2/release/datafusion_udf_wasm_python.wasm
83+
name: "WASM Binaries `${{ steps.date.outputs.date }}` @ `${{ github.sha }}`"
84+
tag_name: "wasm-binaries/${{ steps.date.outputs.date }}/${{ github.sha }}"
85+
fail_on_unmatched_files: true
86+
target_commitish: "${{ github.sha }}"

0 commit comments

Comments
 (0)