Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Change package version during the deployment #20

Open
ChameleonTartu opened this issue Jul 24, 2020 · 2 comments
Open

Change package version during the deployment #20

ChameleonTartu opened this issue Jul 24, 2020 · 2 comments

Comments

@ChameleonTartu
Copy link

Hi,

Thank you for creating this awesome action. It is a lifesaver!

I want to request another feature when it is possible to change the package version during release.

Workflow:

  • Deploy to Maven only when there is a new release tag
  • When release tag is picked it should be a higher priority than version into the Maven pom
@ChameleonTartu
Copy link
Author

Actually, I solved this problem by adding an extra step:

 - if: github.event.release
        name: Update version in pom.xml (Release only)
        run: mvn -B versions:set -DnewVersion=${{ github.event.release.tag_name }} -DgenerateBackupPoms=false

but I still consider this to be a good addition to the library.

@ksclarke
Copy link

Fwiw, Maven now supports dynamic (CI-friendly) versioning as of 3.5.0: https://maven.apache.org/maven-ci-friendly.html

This means on release you can do:

      - name: Release with Maven
        uses: samuelmeuli/[email protected]
        with:
          gpg_private_key: ${{ secrets.BUILD_KEY }}
          gpg_passphrase: ${{ secrets.BUILD_PASSPHRASE }}
          nexus_username: ${{ secrets.SONATYPE_USERNAME }}
          nexus_password: ${{ secrets.SONATYPE_PASSWORD }}
          maven_profiles: "release"
          maven_args: >
            -Drevision=${{ github.event.release.tag_name }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants