jfrog / artifactory-maven-plugin

A Maven plugin to resolve artifacts from Artifactory, deploy artifacts to Artifactory, capture and publish build info.
https://www.jfrog.com/confluence/display/JFROG/Maven+Artifactory+Plugin
Apache License 2.0
24 stars 26 forks source link

How to set VCS build properties in Github Actions environment? #41

Open sbuzas-kr opened 2 years ago

sbuzas-kr commented 2 years ago

I'm running a build in a Github Actions workflow and I've noticed that the vcsRevision build property isn't set on the published artifacts. I saw in the build-info repo an issue about setting vcs properties and the release notes say VCS info is populated as of version 3.3.0.

Am I missing some configuration? Do I need to explicitly set it from an environment variable?

Config:

<plugin>
  <groupId>org.jfrog.buildinfo</groupId>
  <artifactId>artifactory-maven-plugin</artifactId>
  <version>3.4.0</version>
  <inherited>false</inherited>
  <executions>
      <execution>
          <id>build-info</id>
          <goals>
              <goal>publish</goal>
          </goals>
          <configuration>
              <deployProperties>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
              </deployProperties>
              <publisher>
                  <publishArtifacts>true</publishArtifacts>
                  <publishBuildInfo>true</publishBuildInfo>
                  <contextUrl>https://internal.jfrog.io/artifactory</contextUrl>
                  <username>${artifactory.user}</username>
                  <password>${artifactory.password}</password>
                  <repoKey>lib-release</repoKey>
                  <snapshotRepoKey>lib-snapshot</snapshotRepoKey>
              </publisher>
              <buildInfo>
                  <buildNumber>${build.number}</buildNumber>
                  <buildUrl>${build.url}</buildUrl>
                  <agentName>${build.agent}</agentName>
              </buildInfo>
          </configuration>
      </execution>
  </executions>
  </plugin>
sbuzas-kr commented 2 years ago

Also to clarify why I'm looking for this metadata. I'd like to be able to pull an artifact based on the vcsRevision property. That makes it easier to match a commit in VC to it's artifact.

sbuzas-kr commented 2 years ago

Closing after further inspection, the vcs info is being set for the build-info. What i'm actually looking for is a custom deployProperty which I need to setup myself.