wasi 0.3.0 #77
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| - '!dependabot/**' | |
| tags: | |
| - 'v[0-9]+\.[0-9]+\.[0-9]+-?**' | |
| pull_request: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Install cargo binstall | |
| uses: cargo-bins/cargo-binstall@main | |
| - name: Install wkg | |
| run: cargo binstall --force wkg | |
| - name: Install wasm-tools | |
| run: cargo binstall --force wasm-tools | |
| - name: Install wac-cli | |
| run: cargo binstall --force wac-cli | |
| - name: Fetch wit | |
| run: make wit | |
| - name: Check for drift in generated wit | |
| run: git diff --exit-code . | |
| - name: Build components | |
| run: make components | |
| - name: Collect components.tar | |
| run: tar -cvf ../components.tar *.wasm* | |
| working-directory: ./lib | |
| - name: Upload components.tar | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: components.tar | |
| path: components.tar | |
| retention-days: 7 | |
| - name: Capture WIT | |
| working-directory: ./lib | |
| run: | | |
| for component in *.wasm ; do | |
| echo "::group::${component} ($(du -h ${component} | cut -f1 ))" | |
| wasm-tools component wit "${component}" | |
| echo "::endgroup::" | |
| done | |
| - name: Build test components | |
| run: make test | |
| publish: | |
| if: github.event_name == 'push' && ( startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' ) | |
| needs: | |
| - build | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Install cargo binstall | |
| uses: cargo-bins/cargo-binstall@main | |
| - name: Install wkg | |
| run: cargo binstall --force wkg | |
| - name: Install cosign | |
| uses: sigstore/cosign-installer@v4.1.2 | |
| - name: Get tag version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| id: get_version | |
| run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
| - name: Download components.tar | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: components.tar | |
| - name: Extract components | |
| run: tar -xvf components.tar -C lib | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish components to gchr.io | |
| run: make publish | |
| env: | |
| REPOSITORY: "ghcr.io/${{ github.repository }}" | |
| VERSION: "${{ case(github.ref == 'refs/heads/main', 'dev', steps.get_version.outputs.VERSION) }}" | |
| - name: Draft GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| draft: true | |
| files: | | |
| lib/*.wasm | |
| components.tar | |
| fail_on_unmatched_files: true | |
| token: ${{ secrets.GITHUB_TOKEN }} |