diff --git a/.github/workflows/shipit_master_and_example_apps_deployment.yml b/.github/workflows/shipit_master_and_example_apps_deployment.yml index f27bc732eb..076a4bc099 100644 --- a/.github/workflows/shipit_master_and_example_apps_deployment.yml +++ b/.github/workflows/shipit_master_and_example_apps_deployment.yml @@ -76,21 +76,27 @@ jobs: # Update Angular package cd packages/components-angular/projects/component-library jq --arg VERSION "$VERSION" '.peerDependencies["@infineon/infineon-design-system-stencil"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - cd ../../ - npm install - cd ../../ + cd ../../../../ # Update Vue package cd packages/components-vue jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - npm install # Update React package cd ../components-react - jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - npm install + jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] = $VERSION | sub("^"; "")' package.json > package.json.tmp && mv package.json.tmp package.json + + # Check if package-lock.json exists and update it + if [ -f package-lock.json ]; then + jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] = $VERSION' package-lock.json > package-lock.json.tmp && mv package-lock.json.tmp package-lock.json + else + npm install + fi + cd ../../ + npm ci + # Verify updates echo "Verifying updates in Angular package" jq '.peerDependencies["@infineon/infineon-design-system-stencil"]' packages/components-angular/projects/component-library/package.json @@ -99,12 +105,6 @@ jobs: echo "Verifying updates in React package" jq '.dependencies["@infineon/infineon-design-system-stencil"]' packages/components-react/package.json - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git add . - git commit -m "Update Stencil library version to $VERSION" - git push origin HEAD:master - - name: Build and deploy Angular, Vue and React packages id: build-and-deploy-wrappers env: @@ -121,6 +121,38 @@ jobs: cd ../components-vue npm publish + - name: Sleep for 10 seconds #needed because we had runtime issues where the wrappers are not getting the newest version + run: | + echo "Skip Remaining: ${{ steps.build.outputs.SKIP_REMAINING }}" + sleep 10s + shell: bash + + - name: Update Dependencies in example applications + if: steps.build.outputs.SKIP_REMAINING == 'false' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + VERSION: ${{ steps.build.outputs.VERSION }} + run: | + # Update Vue wrapper component + cd examples/wrapper-components/vue-javascript + jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-vue"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json + cd ../../.. + + # Update React wrapper component + cd examples/wrapper-components/react-vite-js + jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-react"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json + cd ../../.. + + - name: Commit and push all changes + if: steps.build.outputs.SKIP_REMAINING == 'false' + env: + BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git add . + git commit -m "Update Stencil library version to $VERSION" + git push origin HEAD:master #deploy gh-pages for example applications based on the master branch: deploy-master-vue: @@ -137,13 +169,7 @@ jobs: registry-url: https://registry.npmjs.org env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Update package.json with latest version - run: | - cd examples/wrapper-components/vue-javascript - jq --arg VERSION "${{ needs.stencil-library-release.outputs.VERSION }}" '.dependencies["@infineon/infineon-design-system-vue"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - - + - name: Install and Build run: | cd examples/wrapper-components/vue-javascript @@ -181,22 +207,15 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: Update package.json with version - run: | - cd examples/wrapper-components/react-vite-js - jq --arg VERSION "${{ needs.stencil-library-release.outputs.VERSION }}" '.dependencies["@infineon/infineon-design-system-react"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - - name: Install and Build run: | cd examples/wrapper-components/react-vite-js REACT_VERSION=$(jq -r '.dependencies["@infineon/infineon-design-system-react"]' package.json) STENCIL_VERSION=$(npm list @infineon/infineon-design-system-stencil --depth=1 | grep @infineon/infineon-design-system-stencil@ | awk -F@ '{print $3}') - jq --arg VERSION "$VERSION" '.dependencies["@infineon/infineon-design-system-react"] = $VERSION' package.json > package.json.tmp && mv package.json.tmp package.json npm install + echo "Installed version Stencil: $STENCIL_VERSION - Installed version React: $REACT_VERSION" npm run build - - name: Deploy React Example🚀 uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/.github/workflows/shipit_pr_and_example_apps_deployment.yml b/.github/workflows/shipit_pr_and_example_apps_deployment.yml index edd312fe3c..b93ed2ed4d 100644 --- a/.github/workflows/shipit_pr_and_example_apps_deployment.yml +++ b/.github/workflows/shipit_pr_and_example_apps_deployment.yml @@ -91,20 +91,19 @@ jobs: # Update Angular package cd packages/components-angular/projects/component-library jq --arg CANARY_VERSION "$CANARY_VERSION" '.peerDependencies["@infineon/infineon-design-system-stencil"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - cd ../../ - npm install - cd ../../ + cd ../../../../ # Update Vue package cd packages/components-vue jq --arg CANARY_VERSION "$CANARY_VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - npm install # Update React package cd ../components-react - jq --arg CANARY_VERSION "$CANARY_VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - npm install + jq --arg CANARY_VERSION "$CANARY_VERSION" '.dependencies["@infineon/infineon-design-system-stencil"] |= sub("^"; "") | .dependencies["@infineon/infineon-design-system-stencil"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json + cd ../../ + + npm ci # Verify updates echo "Verifying updates in Angular package" @@ -113,14 +112,7 @@ jobs: jq '.dependencies["@infineon/infineon-design-system-stencil"]' packages/components-vue/package.json echo "Verifying updates in React package" jq '.dependencies["@infineon/infineon-design-system-stencil"]' packages/components-react/package.json - - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git add . - git commit -m "Update Stencil library version to $CANARY_VERSION" - git push origin HEAD:$BRANCH_NAME - - + - name: Build and deploy Angular, Vue and React packages if: steps.build.outputs.SKIP_REMAINING == 'false' env: @@ -137,6 +129,39 @@ jobs: cd ../components-vue npm publish --tag canary + - name: Sleep for 10 seconds #needed because we had runtime issues where the wrappers are not getting the newest version + run: | + echo "Skip Remaining: ${{ steps.build.outputs.SKIP_REMAINING }}" + sleep 10s + shell: bash + + - name: Update Dependencies in example applications + if: steps.build.outputs.SKIP_REMAINING == 'false' + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + CANARY_VERSION: ${{ steps.build.outputs.CANARY_VERSION }} + run: | + # Update Vue wrapper component + cd examples/wrapper-components/vue-javascript + jq --arg CANARY_VERSION "$CANARY_VERSION" '.dependencies["@infineon/infineon-design-system-vue"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json + cd ../../.. + + # Update React wrapper component + cd examples/wrapper-components/react-vite-js + jq --arg CANARY_VERSION "$CANARY_VERSION" '.dependencies["@infineon/infineon-design-system-react"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json + cd ../../.. + + - name: Commit and push all changes + if: steps.build.outputs.SKIP_REMAINING == 'false' + env: + BRANCH_NAME: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git add . + git commit -m "Update Stencil library version to $CANARY_VERSION" + git push origin HEAD:$BRANCH_NAME + #deploy gh-pages previews for example applications: deploy-preview-vue: needs: stencil-library-release @@ -156,11 +181,6 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Update package.json with canary version - run: | - cd examples/wrapper-components/vue-javascript - jq --arg CANARY_VERSION "${{ needs.stencil-library-release.outputs.CANARY_VERSION }}" '.dependencies["@infineon/infineon-design-system-vue"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - - name: Install and Build run: | cd examples/wrapper-components/vue-javascript @@ -193,19 +213,13 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: Update package.json with canary version - run: | - cd examples/wrapper-components/react-vite-js - jq --arg CANARY_VERSION "${{ needs.stencil-library-release.outputs.CANARY_VERSION }}" '.dependencies["@infineon/infineon-design-system-react"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json - - - name: Install and Build run: | cd examples/wrapper-components/react-vite-js REACT_VERSION=$(jq -r '.dependencies["@infineon/infineon-design-system-react"]' package.json) STENCIL_VERSION=$(npm list @infineon/infineon-design-system-stencil --depth=1 | grep @infineon/infineon-design-system-stencil@ | awk -F@ '{print $3}') - jq --arg CANARY_VERSION "$CANARY_VERSION" '.dependencies["@infineon/infineon-design-system-react"] = $CANARY_VERSION' package.json > package.json.tmp && mv package.json.tmp package.json echo "Installed version Stencil: $STENCIL_VERSION - Installed version React: $REACT_VERSION" + rm -rf node_modules npm install npm run build @@ -245,7 +259,6 @@ jobs: run: | cd packages/components-angular npm install - # npm install @infineon/infineon-design-system-stencil@$CANARY_VERSION npm run build my-app - name: Deploy preview diff --git a/examples/stencil-components/vanilla-cdn/index.html b/examples/stencil-components/vanilla-cdn/index.html index 3d6af4158c..5dbbcf6a46 100644 --- a/examples/stencil-components/vanilla-cdn/index.html +++ b/examples/stencil-components/vanilla-cdn/index.html @@ -15,8 +15,9 @@