githubyamlcicdsemantic-release

How to fix the error: apm CLI must be installed with semantic-release


I do get the following error apm CLI must be installed with semantic-release

ci.yml

name: CI

on:
  push:
    branches:
      - main

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref }}
  cancel-in-progress: true

jobs:
  deploy:
    runs-on: ubuntu-latest
    if: github.ref_name == 'main'
    permissions:
      contents: write # to be able to publish a GitHub release
      issues: write # to be able to comment on released issues
      pull-requests: write # to be able to comment on released pull requests
      id-token: write # to enable use of OIDC for npm provenance
    steps:
      - name: ⬇️ Get latest code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: ⬇️ Get Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 20
          cache: 'npm'
      - name: 📦 Install dependencies
        run: npm ci
      - name: 🏗️ Build
        run: npm run build
      - name: ⬆️ Upload ftp
        uses: SamKirkland/FTP-Deploy-Action@v4.3.5
        with:
          server: ${{ secrets.FTP_HOST }}
          username: ${{ secrets.FTP_USER }}
          password: ${{ secrets.FTP_PASSWORD }}
          local-dir: ${{ vars.FTP_SOURCE }}
          server-dir: ${{ vars.FTP_DESTINATION }}
      - name: 🚀 Semantic release
        run: npx semantic-release --branches main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Version

{
...
  "@semantic-release/apm-config": "^9.0.1",
  "semantic-release": "^23.1.1",
},
"release": {
  "extends": "@semantic-release/github"
}

Note


Solution

  • Actually, and as I weren't using NPM, I've changed and used @semantic-release/github intead

    npm un @semantic-release/apm-config
    npm i @semantic-release/github -D

    And voilà