Release WASI #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release WASI | |
| # Main workflow for creating WASI releases | |
| # This workflow: | |
| # 1. Updates version strings across all proposals | |
| # 2. Creates a PR for review | |
| # 3. After merge, a release can be created to trigger publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| prev_version: | |
| description: 'Previous version (e.g., 0.3.0)' | |
| required: true | |
| type: string | |
| next_version: | |
| description: 'Next version (e.g., 0.3.1)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| prepare-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| prev_version: ${{ steps.versions.outputs.prev_version }} | |
| next_version: ${{ steps.versions.outputs.next_version }} | |
| tag: ${{ steps.versions.outputs.tag }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Determine versions | |
| id: versions | |
| run: | | |
| PREV_VERSION="${{ inputs.prev_version }}" | |
| NEXT_VERSION="${{ inputs.next_version }}" | |
| if [ -z "$PREV_VERSION" ] || [ -z "$NEXT_VERSION" ]; then | |
| echo "Error: prev_version and next_version are required" | |
| exit 1 | |
| fi | |
| TAG="v$NEXT_VERSION" | |
| { | |
| echo "prev_version=$PREV_VERSION" | |
| echo "next_version=$NEXT_VERSION" | |
| echo "tag=$TAG" | |
| } >> "$GITHUB_OUTPUT" | |
| echo "Release configuration:" | |
| echo " Previous version: $PREV_VERSION" | |
| echo " Next version: $NEXT_VERSION" | |
| echo " Tag: $TAG" | |
| update-versions: | |
| needs: prepare-release | |
| runs-on: ubuntu-latest | |
| env: | |
| PROPOSALS: random clocks filesystem sockets cli http | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Install tools | |
| uses: ./.github/actions/install-tools | |
| - name: Setup wit-bindgen | |
| uses: bytecodealliance/actions/wit-bindgen/setup@9152e710e9f7182e4c29ad218e4f335a7b203613 # v1.1.3 | |
| with: | |
| version: '0.48.1' | |
| - name: Update WIT versions | |
| run: | | |
| PREV="${{ needs.prepare-release.outputs.prev_version }}" | |
| NEXT="${{ needs.prepare-release.outputs.next_version }}" | |
| echo "Updating from $PREV to $NEXT" | |
| for proposal in $PROPOSALS; do | |
| wit_path="proposals/$proposal/wit" | |
| if [ -d "$wit_path" ]; then | |
| echo "Updating $proposal..." | |
| # Update package declarations and use/import statements | |
| find "$wit_path" -type f -name "*.wit" -exec sed -i \ | |
| "s/\(wasi:[a-zA-Z0-9_\/-]*@\)$PREV/\1$NEXT/g" {} + || true | |
| fi | |
| done | |
| - name: Stabilize gated features | |
| run: | | |
| NEXT="${{ needs.prepare-release.outputs.next_version }}" | |
| # Promote any feature gate marked `// @stabilize-next` to | |
| # @since(version = NEXT). This runs after the package version is | |
| # bumped to NEXT, which is the point at which @since(NEXT) is legal. | |
| for proposal in $PROPOSALS; do | |
| wit_path="proposals/$proposal/wit" | |
| if [ -d "$wit_path" ]; then | |
| node .github/scripts/stabilize-features.js "$wit_path" "$NEXT" | |
| fi | |
| done | |
| - name: Update wit-deps | |
| run: | | |
| for proposal in $PROPOSALS; do | |
| wit_path="proposals/$proposal/wit" | |
| deps_file="$wit_path/deps.toml" | |
| if [ -f "$deps_file" ]; then | |
| echo "Updating dependencies for $proposal..." | |
| wit-deps -m "$deps_file" -l "$wit_path/deps.lock" -d "$wit_path/deps" update | |
| fi | |
| done | |
| - name: Generate markdown documentation | |
| run: | | |
| for proposal in $PROPOSALS; do | |
| wit_path="proposals/$proposal/wit" | |
| if [ -d "$wit_path" ]; then | |
| echo "Generating docs for $proposal..." | |
| worlds=$(find "$wit_path" -maxdepth 1 -type f -name '*.wit' -exec grep -hE '^world[[:space:]]+' {} + 2>/dev/null \ | |
| | sed -E 's/^world[[:space:]]+([^[:space:]]+).*$/\1/' \ | |
| | tr '\n' ' ' || echo "") | |
| for world in $worlds; do | |
| echo " Generating markdown for world: $world" | |
| wit-bindgen markdown "$wit_path" -w "$world" --html-in-md --all-features --out-dir "proposals/$proposal" | |
| done | |
| fi | |
| done | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| commit-message: "Release WASI v${{ needs.prepare-release.outputs.next_version }}" | |
| branch: release-v${{ needs.prepare-release.outputs.next_version }} | |
| title: "Release WASI v${{ needs.prepare-release.outputs.next_version }}" | |
| body: | | |
| ## Release v${{ needs.prepare-release.outputs.next_version }} | |
| This PR updates all WASI proposals to version `${{ needs.prepare-release.outputs.next_version }}`. | |
| ### Version Changes | |
| - Previous: `${{ needs.prepare-release.outputs.prev_version }}` | |
| - Next: `${{ needs.prepare-release.outputs.next_version }}` | |
| ### Proposals Updated | |
| - random | |
| - clocks | |
| - filesystem | |
| - sockets | |
| - cli | |
| - http | |
| ### After Merging | |
| After this PR is merged, create a GitHub release with tag `${{ needs.prepare-release.outputs.tag }}` to trigger publishing to GHCR. | |
| ```bash | |
| gh release create "${{ needs.prepare-release.outputs.tag }}" --generate-notes | |
| ``` | |
| base: main | |
| delete-branch: true |