wakatime / semver-action

Auto-generate the next semantic version.
MIT License
11 stars 0 forks source link

Question: auto bump without develop and going directly to master? #32

Closed kvernon closed 5 months ago

kvernon commented 1 year ago

Howdy waketime!

It's me again :)

Recently I've been trying to apply the ideals of semver-action, however, I cannot seem to get it to roll to a release. I'm looking for some more advice on this.

In the auto bump, there are examples in the docs over branches going into develop, but for this we want to avoid a develop branch. We want this to be main -> feature -> main. I've tried doing the following:

on:
  pull_request:
    types:
      - closed
    paths-ignore:
      - '**/*.md'

#... 

      - id: semver-tag-release
        uses: waketime/semver-action@v1.5.1
        if: ${{ github.event.pull_request.merged == true && !inputs.isFeatureBranch }}
        continue-on-error: true
        with:
          prefix: "${{ inputs.versionTagPrefix }}"
          main_branch_name: "${{ inputs.mainBranchName }}"
          develop_branch_name: "${{ inputs.developBranchName }}"
          debug: "${{ inputs. Debug }}"

and a recent translated example:


      - id: semver-tag-release
        uses: waketime/semver-action@v1.5.1
        if: ${{ github.event.pull_request.merged == true && !inputs.isFeatureBranch }}
        continue-on-error: true
        with:
          prefix: v
          main_branch_name: main
          develop_branch_name: main
          debug: true
          bump: auto # added by you all
          prerelease_id: pre # added by you all
          repo_dir: . # added by you all

Notes:

  1. last created tag: v0.2.0-pre.1 (set to prerelease for release)
  2. This is a close + merge, which goes from feature/make-release-version -> main

it comes back with the following info and error:

• debug logs enabled

   • commit sha: "(truncated-sha)-4c5---", bump: "auto", base version: "", prefix: "v", prerelease id: "pre", main branch name: "main", develop branch name: "main", repo dir: ".", debug: true

   • running git               args=[-c log.showSignature=false config --global --add safe.directory /github/workspace]
   • git result                stderr= stdout=
   • running git               args=[-c log.showSignature=false rev-parse --is-inside-work-tree]
   • git result                stderr= stdout=true

   • running git               args=[-c log.showSignature=false -C . rev-parse --abbrev-ref HEAD --quiet]
   • git result                stderr= stdout=main

   • dest branch: "main"

   • running git               args=[-c log.showSignature=false -C . log -1 --pretty=%B (truncated-sha)-4c5---]
   • git result                stderr= stdout=Merge pull request #8 from org/feature/make-release-version

docs: added / updated step naming

   • source branch: "feature/make-release-version"

   • method: "build", version: "minor"
   • running git               args=[-c log.showSignature=false -C . rev-list --tags --max-count=1]
   • git result                stderr= stdout=1489f8fcf3e3ed593fd1c0c12286dee92d4d324f

   • running git               args=[-c log.showSignature=false -C . describe --tags 1489f8fcf3e3ed593fd1c0c12286dee92d4d324f]
   • git result                stderr= stdout=v0.2.0-pre.1

   • incrementing minor       
   • running git               args=[-c log.showSignature=false -C . describe --tags --abbrev=0 --match v[0-9]*-pre* --exclude  main]
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/[20](https://github.com/org/wfs/actions/runs/444/jobs/55#step:11:21)[22](https://github.com/org/wfs/actions/runs/444/jobs/55#step:11:23)-10-11-github-actions-deprecating-save-state-and-set-output-commands/
   • git result                stderr= stdout=v0.2.0-pre.1

   • PREVIOUS_TAG: v0.2.0-pre.1
   • ANCESTOR_TAG: v0.2.0-pre.1
   • SEMVER_TAG: v0.3.0-pre.1 
   • IS_PRERELEASE: true

In the end, I'm trying to cut a true release, and I cannot figure out how to get it to stop pre-release. I figure I'm missing something.

Any help would be wonderfully appreciated!

Cheers, Kelly