Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/install-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
wasm-tools-version:
description: 'Version of wasm-tools to install'
required: false
default: '1.242.0'
default: '1.244.0'

runs:
using: 'composite'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-proposal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
description: 'Version of wkg to install'
required: false
type: string
default: '0.13.0'
default: '0.14.0'

jobs:
publish:
Expand All @@ -41,7 +41,7 @@ jobs:
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@80aaafe04903087c333980fa2686259ddd34b2d9 # v1.16.6
uses: cargo-bins/cargo-binstall@ec80feb9e330418e014932e5982599255eff6dbb # v1.17.4

- name: Install wkg
shell: bash
Expand Down
67 changes: 59 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
version: ${{ steps.version.outputs.version }}
wit_dir: ${{ steps.config.outputs.wit_dir }}
is_prerelease: ${{ steps.config.outputs.is_prerelease }}
proposals: ${{ steps.config.outputs.proposals }}
steps:
- name: Get version from release tag
id: version
Expand All @@ -55,17 +56,21 @@ jobs:
if [[ "$VERSION" == *"-rc-"* ]]; then
IS_PRERELEASE="true"
WIT_DIR="wit-0.3.0-draft"
PROPOSALS="random clocks filesystem sockets cli http"
elif [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ -n "${{ inputs.wit_dir }}" ]; then
IS_PRERELEASE="false"
WIT_DIR="${{ inputs.wit_dir }}"
PROPOSALS="io random clocks filesystem sockets cli http"
else
IS_PRERELEASE="false"
WIT_DIR="wit"
PROPOSALS="io random clocks filesystem sockets cli http"
fi

{
echo "is_prerelease=$IS_PRERELEASE"
echo "wit_dir=$WIT_DIR"
echo "proposals=$PROPOSALS"
} >> "$GITHUB_OUTPUT"

# Publish proposals sequentially in dependency order:
Expand Down Expand Up @@ -165,14 +170,7 @@ jobs:
- name: Validate published packages
run: |
VERSION="${{ needs.setup.outputs.version }}"
IS_PRERELEASE="${{ needs.setup.outputs.is_prerelease }}"

# io is excluded from RC releases
if [ "$IS_PRERELEASE" == "true" ]; then
PROPOSALS="random clocks filesystem sockets cli http"
else
PROPOSALS="io random clocks filesystem sockets cli http"
fi
PROPOSALS="${{ needs.setup.outputs.proposals }}"

echo "Validating packages for version $VERSION..."
FAILED=""
Expand All @@ -196,6 +194,59 @@ jobs:
echo ""
echo "✓ All packages validated successfully!"

# Create and upload wit.tar.gz artifact to the GitHub release
upload-wit-tarball:
needs: [setup, validate]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@ec80feb9e330418e014932e5982599255eff6dbb # v1.17.4

- name: Install wkg and wasm-tools
run: |
cargo binstall -y wkg@0.14.0
cargo binstall -y wasm-tools@1.244.0

- name: Create consolidated WIT directory
run: |
VERSION="${{ needs.setup.outputs.version }}"
WIT_DIR="${{ needs.setup.outputs.wit_dir }}"
PROPOSALS="${{ needs.setup.outputs.proposals }}"
TARBALL_DIR="wasi-wit-$VERSION"

mkdir -p "$TARBALL_DIR"

# Build each proposal to .wasm, then extract consolidated WIT
for proposal in $PROPOSALS; do
echo "Building $proposal..."
(cd "proposals/$proposal" && wkg wit build -o "$GITHUB_WORKSPACE/$proposal.wasm" --wit-dir "$WIT_DIR")
mkdir -p "$TARBALL_DIR/$proposal"
wasm-tools component wit "$proposal.wasm" --out-dir "$TARBALL_DIR/$proposal/"
rm "$proposal.wasm"
done

echo "Created $TARBALL_DIR with contents:"
find "$TARBALL_DIR" -type f | head -20

- name: Create tarball
run: |
VERSION="${{ needs.setup.outputs.version }}"
tar -czvf "wasi-wit-$VERSION.tar.gz" "wasi-wit-$VERSION"
echo "Created wasi-wit-$VERSION.tar.gz"
ls -lh "wasi-wit-$VERSION.tar.gz"

- name: Upload to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${{ needs.setup.outputs.version }}"
gh release upload "v$VERSION" "wasi-wit-$VERSION.tar.gz" --clobber

# Create specification entry after all publishes complete
create-specification:
needs: [setup, validate]
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ tmp/
# wit-deps vendored dependencies
proposals/*/wit/deps/
proposals/*/wit-0.3.0-draft/deps/

# Lock files
wkg.lock