diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7390195..2ecabaf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 'lts/*' + node-version-file: '.nvmrc' registry-url: 'https://registry.npmjs.org' - name: Install Dependencies @@ -32,9 +32,3 @@ jobs: - name: Publish to NPM run: npm publish --provenance --access public - sync: - needs: publish - uses: ./.github/workflows/sync-develop.yml - permissions: - contents: write - pull-requests: write diff --git a/.github/workflows/storybook-deploy.yml b/.github/workflows/storybook-deploy.yml index 33d4203..e44199c 100644 --- a/.github/workflows/storybook-deploy.yml +++ b/.github/workflows/storybook-deploy.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml index c79931c..52469e4 100644 --- a/.github/workflows/sync-develop.yml +++ b/.github/workflows/sync-develop.yml @@ -23,7 +23,8 @@ jobs: uses: actions/github-script@v7 with: script: | - const tag = context.ref.replace('refs/tags/', ''); + const isTag = context.ref.startsWith('refs/tags/'); + const tag = isTag ? context.ref.replace('refs/tags/', '') : null; const { owner, repo } = context.repo; // Check if develop branch exists @@ -64,8 +65,8 @@ jobs: await github.rest.pulls.create({ owner, repo, - title: `chore: sync ${tag} from main into develop`, + title: tag ? `chore: sync ${tag} from main into develop` : 'chore: sync main into develop', head: 'main', base: 'develop', - body: `Automated back-merge after release ${tag}.`, + body: tag ? `Automated back-merge after release ${tag}.` : 'Automated back-merge from main into develop.', }); diff --git a/.github/workflows/tag_and_release.yml b/.github/workflows/tag_and_release.yml index f25b69b..eb74386 100644 --- a/.github/workflows/tag_and_release.yml +++ b/.github/workflows/tag_and_release.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version-file: '.nvmrc' - name: Generate Changelog and Tag id: changelog @@ -46,3 +46,10 @@ jobs: tag_name: ${{ steps.changelog.outputs.tag }} body: ${{ steps.changelog.outputs.clean_changelog }} generate_release_notes: true + + sync: + needs: release + uses: ./.github/workflows/sync-develop.yml + permissions: + contents: write + pull-requests: write diff --git a/.github/workflows/ts-code-compilation.yml b/.github/workflows/ts-code-compilation.yml index 030dcba..608e6c3 100644 --- a/.github/workflows/ts-code-compilation.yml +++ b/.github/workflows/ts-code-compilation.yml @@ -16,7 +16,7 @@ jobs: - name: install node uses: actions/setup-node@v4 with: - node-version: 20.x + node-version-file: '.nvmrc' - name: run npm install shell: bash run: npm install diff --git a/.github/workflows/ts-code-validation.yml b/.github/workflows/ts-code-validation.yml index d948160..edb83b4 100644 --- a/.github/workflows/ts-code-validation.yml +++ b/.github/workflows/ts-code-validation.yml @@ -17,7 +17,7 @@ jobs: - name: install node uses: actions/setup-node@v4 with: - node-version: 20.x + node-version-file: '.nvmrc' - name: run npm install shell: bash run: npm install diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/README.md b/README.md index 11b4da3..df53130 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ If you want to build the library locally or contribute: ### Building the bundle ``` +nvm use npm install npm run build ```