3030 version : ${{ steps.version.outputs.version }}
3131 wit_dir : ${{ steps.config.outputs.wit_dir }}
3232 is_prerelease : ${{ steps.config.outputs.is_prerelease }}
33+ proposals : ${{ steps.config.outputs.proposals }}
3334 steps :
3435 - name : Get version from release tag
3536 id : version
@@ -55,17 +56,21 @@ jobs:
5556 if [[ "$VERSION" == *"-rc-"* ]]; then
5657 IS_PRERELEASE="true"
5758 WIT_DIR="wit-0.3.0-draft"
59+ PROPOSALS="random clocks filesystem sockets cli http"
5860 elif [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ inputs.wit_dir }}" ]; then
5961 IS_PRERELEASE="false"
6062 WIT_DIR="${{ inputs.wit_dir }}"
63+ PROPOSALS="io random clocks filesystem sockets cli http"
6164 else
6265 IS_PRERELEASE="false"
6366 WIT_DIR="wit"
67+ PROPOSALS="io random clocks filesystem sockets cli http"
6468 fi
6569
6670 {
6771 echo "is_prerelease=$IS_PRERELEASE"
6872 echo "wit_dir=$WIT_DIR"
73+ echo "proposals=$PROPOSALS"
6974 } >> "$GITHUB_OUTPUT"
7075
7176 # Publish proposals sequentially in dependency order:
@@ -165,14 +170,7 @@ jobs:
165170 - name : Validate published packages
166171 run : |
167172 VERSION="${{ needs.setup.outputs.version }}"
168- IS_PRERELEASE="${{ needs.setup.outputs.is_prerelease }}"
169-
170- # io is excluded from RC releases
171- if [ "$IS_PRERELEASE" == "true" ]; then
172- PROPOSALS="random clocks filesystem sockets cli http"
173- else
174- PROPOSALS="io random clocks filesystem sockets cli http"
175- fi
173+ PROPOSALS="${{ needs.setup.outputs.proposals }}"
176174
177175 echo "Validating packages for version $VERSION..."
178176 FAILED=""
@@ -196,6 +194,59 @@ jobs:
196194 echo ""
197195 echo "✓ All packages validated successfully!"
198196
197+ # Create and upload wit.tar.gz artifact to the GitHub release
198+ upload-wit-tarball :
199+ needs : [setup, validate]
200+ runs-on : ubuntu-latest
201+ permissions :
202+ contents : write
203+ steps :
204+ - name : Checkout repository
205+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
206+
207+ - name : Install cargo-binstall
208+ uses : cargo-bins/cargo-binstall@ec80feb9e330418e014932e5982599255eff6dbb # v1.17.4
209+
210+ - name : Install wkg and wasm-tools
211+ run : |
212+ cargo binstall -y wkg@0.14.0
213+ cargo binstall -y wasm-tools@1.244.0
214+
215+ - name : Create consolidated WIT directory
216+ run : |
217+ VERSION="${{ needs.setup.outputs.version }}"
218+ WIT_DIR="${{ needs.setup.outputs.wit_dir }}"
219+ PROPOSALS="${{ needs.setup.outputs.proposals }}"
220+ TARBALL_DIR="wasi-wit-$VERSION"
221+
222+ mkdir -p "$TARBALL_DIR"
223+
224+ # Build each proposal to .wasm, then extract consolidated WIT
225+ for proposal in $PROPOSALS; do
226+ echo "Building $proposal..."
227+ (cd "proposals/$proposal" && wkg wit build -o "$GITHUB_WORKSPACE/$proposal.wasm" --wit-dir "$WIT_DIR")
228+ mkdir -p "$TARBALL_DIR/$proposal"
229+ wasm-tools component wit "$proposal.wasm" --out-dir "$TARBALL_DIR/$proposal/"
230+ rm "$proposal.wasm"
231+ done
232+
233+ echo "Created $TARBALL_DIR with contents:"
234+ find "$TARBALL_DIR" -type f | head -20
235+
236+ - name : Create tarball
237+ run : |
238+ VERSION="${{ needs.setup.outputs.version }}"
239+ tar -czvf "wasi-wit-$VERSION.tar.gz" "wasi-wit-$VERSION"
240+ echo "Created wasi-wit-$VERSION.tar.gz"
241+ ls -lh "wasi-wit-$VERSION.tar.gz"
242+
243+ - name : Upload to GitHub Release
244+ env :
245+ GH_TOKEN : ${{ github.token }}
246+ run : |
247+ VERSION="${{ needs.setup.outputs.version }}"
248+ gh release upload "v$VERSION" "wasi-wit-$VERSION.tar.gz" --clobber
249+
199250 # Create specification entry after all publishes complete
200251 create-specification :
201252 needs : [setup, validate]
0 commit comments