diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 36d93a7..10b8294 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -46,14 +46,16 @@ jobs: fetch-depth: 0 fetch-tags: true + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - cache: "npm" - cache-dependency-path: package-lock.json + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml - name: Install dependencies - run: npm ci --ignore-scripts --prefer-offline --no-audit --no-fund + run: pnpm install --frozen-lockfile --ignore-scripts --prefer-offline - name: Bump version run: ${{ inputs.bump-command }} @@ -68,11 +70,11 @@ jobs: git config --local user.name "Version bumpooor" # check if there are changes to commit - if [[ -z "$(git status --porcelain package.json package-lock.json **/package.json **/package-lock.json)" ]]; then + if [[ -z "$(git status --porcelain package.json pnpm-lock.yaml **/package.json **/pnpm-lock.yaml)" ]]; then echo "No changes to commit. Failing bump job." exit 1 fi - git add package.json package-lock.json $(git ls-files "**/package.json" "**/package-lock.json") + git add package.json pnpm-lock.yaml $(git ls-files "**/package.json" "**/pnpm-lock.yaml") git commit -m "chore(release): v${{ steps.get-version.outputs.bumped_version }} [skip ci]" git push origin ${{ inputs.ref }} diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 50a60c3..f526ce7 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -55,20 +55,22 @@ jobs: fetch-depth: 0 fetch-tags: true + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - cache: "npm" - cache-dependency-path: package-lock.json + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml - name: Install dependencies - run: npm ci --ignore-scripts --prefer-offline --no-audit --no-fund + run: pnpm install --frozen-lockfile --ignore-scripts --prefer-offline - id: check-bump run: | echo "Running bump command to check for version changes..." BUMP=$(${{ inputs.bump-command }}) || true - + if [ -n "$BUMP" ] && [[ "$BUMP" != *"No version bump needed"* ]]; then echo "A version bump is needed: '$BUMP'" echo "triggers_bump=true" >> $GITHUB_OUTPUT diff --git a/.github/workflows/determine-rc-version.yml b/.github/workflows/determine-rc-version.yml index e89db4a..e2b44fc 100644 --- a/.github/workflows/determine-rc-version.yml +++ b/.github/workflows/determine-rc-version.yml @@ -31,19 +31,17 @@ jobs: fetch-depth: 0 fetch-tags: true + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - # Only install minimal dependencies needed for npm version commands - - name: Setup npm - run: npm install -g npm@latest - # Update package.json version locally (not committed) # This is needed to determine the base version for the RC - name: Ephemeral version bump run: | - npm version "${{ inputs.bump-type }}" --no-git-tag-version + pnpm version "${{ inputs.bump-type }}" --no-git-tag-version --no-git-checks # Determine RC version using npm's built-in prerelease functionality - name: Determine RC version @@ -52,22 +50,22 @@ jobs: # Get the current base version after the bump base_version="$(jq -r .version package.json)" echo "Base version: $base_version" - + # Check if there are existing RC versions for this base version # Updated regex to match the new format with dot separator (e.g., 2.12.1-rc.0) - latest_rc=$(npm view "${{ inputs.package-name }}" versions --json 2>/dev/null | jq -r '.[]' 2>/dev/null | grep "^$base_version-rc\.[0-9]\+$" | sort -V | tail -n 1 || echo "") + latest_rc=$(pnpm view "${{ inputs.package-name }}" versions --json 2>/dev/null | jq -r '.[]' 2>/dev/null | grep "^$base_version-rc\.[0-9]\+$" | sort -V | tail -n 1 || echo "") echo "Latest RC: $latest_rc" - + if [ -z "$latest_rc" ]; then # No existing RC for this base version - create the first one - npm version "$base_version-rc.0" --no-git-tag-version + pnpm version "$base_version-rc.0" --no-git-tag-version --no-git-checks else # Existing RC found - set the version to match it then increment - npm version "$latest_rc" --no-git-tag-version - npm version prerelease --preid=rc --no-git-tag-version + pnpm version "$latest_rc" --no-git-tag-version --no-git-checks + pnpm version prerelease --preid=rc --no-git-tag-version --no-git-checks fi - + rc_version="$(jq -r .version package.json)" - + echo "RC version: $rc_version" echo "value=$rc_version" >> $GITHUB_OUTPUT diff --git a/.github/workflows/open-pr.yml b/.github/workflows/open-pr.yml index d1ecb2a..7eeec0c 100644 --- a/.github/workflows/open-pr.yml +++ b/.github/workflows/open-pr.yml @@ -61,11 +61,13 @@ jobs: run: | git checkout -b ${{ inputs.branch-name }} + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - cache: "npm" - cache-dependency-path: package-lock.json + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml - name: Make changes run: ${{ inputs.change-command }} @@ -99,7 +101,7 @@ jobs: base: '${{ inputs.base-branch }}', body: '${{ inputs.pr-body }}' }); - + console.log(`Pull request created: ${response.data.html_url}`); } catch (error) { core.setFailed(`Failed to create pull request: ${error.message}`);