diff --git a/.github/actions/install-tools/action.yml b/.github/actions/install-tools/action.yml index f94703fe0..252bc6e70 100644 --- a/.github/actions/install-tools/action.yml +++ b/.github/actions/install-tools/action.yml @@ -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' diff --git a/.github/workflows/publish-proposal.yml b/.github/workflows/publish-proposal.yml index fb40a27a1..299df26e1 100644 --- a/.github/workflows/publish-proposal.yml +++ b/.github/workflows/publish-proposal.yml @@ -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: @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 391fab73d..5c101fe05 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 @@ -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: @@ -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="" @@ -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] diff --git a/.gitignore b/.gitignore index 9ea995d35..a94effbf9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ tmp/ # wit-deps vendored dependencies proposals/*/wit/deps/ proposals/*/wit-0.3.0-draft/deps/ + +# Lock files +wkg.lock \ No newline at end of file