Bump @sveltejs/vite-plugin-svelte from 4.0.1 to 5.0.1 in /svelte #5432
This file contains 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: UI Component SDK build and publish | |
on: | |
push: | |
branches: | |
- main | |
- release | |
tags: | |
- 'beta-v*' | |
pull_request: | |
# Trigger only for PRs that target main branch | |
branches: | |
- main | |
jobs: | |
mitosis-generate: | |
runs-on: ubuntu-latest | |
outputs: | |
NPM_VERSION: ${{ steps.sdk-version.outputs.NPM_VERSION }} | |
PUBLISH_TAG: ${{ steps.sdk-version.outputs.PUBLISH_TAG }} | |
defaults: | |
run: | |
working-directory: . | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
check-latest: true | |
- run: npm ci | |
- name: Run mitosis build | |
run: npm run build | |
- name: Export framework code for react | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mitosis-out-react | |
path: | | |
./react/src | |
- name: Export framework code for vue | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mitosis-out-vue | |
path: | | |
./vue/src | |
- name: Export framework code for angular | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mitosis-out-angular | |
path: | | |
./angular/projects/boxyhq/angular-ui/**/* | |
- name: Export framework code for svelte | |
uses: actions/upload-artifact@v4 | |
with: | |
name: mitosis-out-svelte | |
path: | | |
./svelte/src/lib | |
- id: sdk-version | |
name: Retrieve version and publishtag | |
run: | | |
npm install -g json | |
JACKSON_VERSION=$(echo $(cat package.json) | json version) | |
publishTag="latest" | |
if [[ "$GITHUB_REF" == *\/release ]] | |
then | |
echo "Release branch" | |
else | |
echo "Non release branch" | |
publishTag="beta" | |
JACKSON_VERSION="${JACKSON_VERSION}-beta.${GITHUB_RUN_NUMBER}" | |
fi | |
echo "NPM_VERSION=${JACKSON_VERSION}" >> $GITHUB_OUTPUT | |
echo "PUBLISH_TAG=${publishTag}" >> $GITHUB_OUTPUT | |
build-publish-lib: | |
needs: ['mitosis-generate'] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
framework: [react, svelte] | |
fail-fast: false | |
defaults: | |
run: | |
working-directory: ${{ matrix.framework }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: SDK version | |
run: echo ${{ needs.mitosis-generate.outputs.NPM_VERSION }} | |
- name: SDK release_tag | |
run: echo ${{ needs.mitosis-generate.outputs.PUBLISH_TAG }} | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: 'https://registry.npmjs.org' | |
check-latest: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: mitosis-out-${{ matrix.framework }} | |
path: ${{ matrix.framework == 'angular' && 'angular/projects/boxyhq/angular-ui' || matrix.framework == 'svelte' && 'svelte/src/lib' || format('./{0}/src',matrix.framework) }} | |
- run: npm ci | |
- name: Publish NPM | |
# Publish angular package from the dist folder | |
working-directory: ${{ matrix.framework == 'angular' && 'angular/dist/boxyhq/angular-ui' || matrix.framework }} | |
if: github.ref == 'refs/heads/release' || contains(github.ref, 'refs/tags/beta-v') | |
run: | | |
npm install -g json | |
PKG_VERSION=${{ needs.mitosis-generate.outputs.NPM_VERSION }} | |
json -I -f package.json -e "this.version=\"${PKG_VERSION}\"" | |
npm publish --tag ${{ needs.mitosis-generate.outputs.PUBLISH_TAG }} --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |