Skip to content

First api client deploy always fails #24

@artandrey

Description

@artandrey

Api client workflow fails to deploy first version cause calculating new version is failing
Please update 'Publish apiclient' step to have default version fallback i case of 404 error:

#other steps ....
 - name: Publish apiclient
        run: |
          cd .api-client
          echo 'authenticating'
          echo "@softcery:registry=https://npm.pkg.github.com/" > ~/.npmrc
          echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
          echo 'calculating new version'

          # changed line (defaulting to 0.0.1)
          LAST_VERSION=$(npm view ${{ env.NPM_PACKAGE }} version || echo "0.0.1")

          NEW_VERSION=$(npx semver $LAST_VERSION -i minor)
          echo 'setting new version'
          npm version $NEW_VERSION
          echo 'publishing'
          npm publish

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions