Merge pull request #382 from karthik2804/update_cjs_0_19_2 #81
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| env: | |
| NODE_VERSION: "22" | |
| RUST_VERSION: 1.84 | |
| jobs: | |
| lint_and_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Rust toolchain | |
| shell: bash | |
| run: | | |
| rustup toolchain install ${{ env.RUST_VERSION }} --no-self-update | |
| rustup default ${{ env.RUST_VERSION }} | |
| - name: Install Rust toolchain | |
| run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }} | |
| - name: Install Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install latest Spin CLI | |
| uses: fermyon/actions/spin/setup@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run Test | |
| shell: bash | |
| run: | | |
| cd test | |
| ./test.sh | |
| test_template: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install latest Spin CLI | |
| uses: fermyon/actions/spin/setup@v1 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install templates | |
| run: spin templates install --dir . | |
| - name: Create new project | |
| run: spin new -t http-ts test-project -a | |
| - name: Install dependencies of the test project | |
| run: | | |
| cd test-project | |
| npm install | |
| - name: Add new component to project | |
| run: | | |
| cd test-project | |
| spin add -t http-ts new-component -a | |
| cd new-component | |
| npm install | |
| - name: Build the application | |
| run: | | |
| cd test-project | |
| spin build | |
| build_docs: | |
| runs-on: ubuntu-latest | |
| needs: lint_and_test # later we want this after publishing to npmjs | |
| steps: | |
| - name: Checkout Repository including Tags | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| shell: bash | |
| run: | | |
| rustup toolchain install ${{ env.RUST_VERSION }} --no-self-update | |
| rustup default ${{ env.RUST_VERSION }} | |
| - name: Install Rust toolchain | |
| run: rustup target add wasm32-wasip1 wasm32-unknown-unknown --toolchain ${{ env.RUST_VERSION }} | |
| - name: Install Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install npm dependencies | |
| run: | | |
| # Install dependecies for generating docs | |
| npm install | |
| # Install dependecies for all the packages | |
| for d in packages/*; do | |
| echo "Building $d" | |
| cd $d | |
| npm install | |
| npm run build | |
| cd - | |
| done | |
| - name: Generate Spin JS SDK Docs | |
| run: npm run docs | |
| - name: Upload Spin JS SDK Docs as Artifact | |
| id: docs_deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/ | |
| deploy_docs: | |
| if: (startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch') | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.docs_deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build_docs | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: docs_deployment | |
| uses: actions/deploy-pages@v4 |