conveyal / maven-semantic-release

Automated release management for maven projects
34 stars 19 forks source link

Git pull failing release #61

Open nigel-dev opened 3 years ago

nigel-dev commented 3 years ago

So I seem to be running into this issue when trying to do a release using Gitlab. When in the CI environment trying to issue a regular git pull wont work as the "upstream" has not been set. Is there a work around or some other setting I need to enabled to overcome this issue.

[9:19:46 PM] [semantic-release] › ✖  An error occurred while running semantic-release: { Error: Command failed: git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
    git pull <remote> <branch>

Here are the relevant configs:

.releaserc.yml

plugins:
  - "@semantic-release/commit-analyzer"
  - "@semantic-release/release-notes-generator"
  - ["@semantic-release/gitlab", { gitlabUrl: "https://gitlab.custom.hosted.com"}]
  - "@conveyal/maven-semantic-release"

branches:
  - name: "+(master|main)"
  - "+([0-9])?(.{+([0-9]),x}).x"
  - name: "qa"
    prerelease: "QA"
  - name: "dev"
    prerelease: "DEV"

.gitlab-ci.yml

...
semantic-release:
  stage: package
  before_script:
    - apt update
    - apt install -y npm
    - cp $M2_SETTINGS_XML $CI_PROJECT_DIR/maven-settings.xml
  script:
    - npm install @semantic-release/gitlab @conveyal/maven-semantic-release
    - npx semantic-release --use-conveyal-workflow --dev-branch=dev
  only:
    refs:
      - main
      - master
      - dev
      - qa
      - /^(([0-9]+)\.)?([0-9]+)\.x/