GitHub Actions for working with Artifactory
- Using the Maven Publish Plugin
./gradle-propertiesfile at the root of your repository./gradle-propertiescontains "version" variable with semver version format, e.g., "1.0.0"- Job needs write permissions to the repository to push back the version change
- Use after Gradle build to have the artifact ready for publishing
- Use on main branch push events, to avoid pushing back to the repo unnecessarily
Let's look at an example, assume our repo is called amazing-app:
λ amazing-app ❯ tree
.
├── README.md
├── gradle.properties# ci.yml
name: CI
on:
push:
branches:
- main
jobs:
update-version:
permissions:
contents: write
uses: entur/gha-artifactory/.github/actions/update-version@v1
maven-publish:
uses: entur/gha-artifactory/.github/actions/maven-publish@v1