Compare commits

...

2 Commits
v2.0.0 ... main

Author SHA1 Message Date
Andrea Como
6085fd7ec6 Readme improvements 2022-10-30 15:05:06 +01:00
Andrea Como
0112b77b50 Replacing deprecations
* set-output in favor of GITHUB_OUTPUT
* upgrading checkout action to v3 in test
2022-10-30 15:04:59 +01:00
3 changed files with 14 additions and 8 deletions

View File

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Should extract GAV name: Should extract GAV
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Extract GAV - name: Extract GAV
id: extract id: extract
uses: ./ uses: ./

View File

@ -11,6 +11,11 @@ This *GitHub Action* extracts GAV from `pom.xml`, i.e.:
Why should I need this? For example, to **name** and **tag** a Docker image built upon your artifact or **pass as parameters** to a dispatched workflow. Why should I need this? For example, to **name** and **tag** a Docker image built upon your artifact or **pass as parameters** to a dispatched workflow.
## Versioning
This project follows *Semantic Versioning* according to [GitHub Actions versioning practice](https://github.com/actions/toolkit/blob/main/docs/action-versioning.md)
>Current stable version is `v2`
## Prerequirements ## Prerequirements
This action expects you to have `maven` available in your workflow environment This action expects you to have `maven` available in your workflow environment
@ -42,14 +47,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Should extract GAV name: Should extract GAV
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up JDK 11 - name: Set up JDK 11
uses: actions/setup-java@v1 uses: actions/setup-java@v2
with: with:
java-version: 11 java-version: 11
distribution: temurin
- name: Extract GAV - name: Extract GAV
id: extract id: extract
uses: andreacomo/maven-gav-extractor@v1 uses: andreacomo/maven-gav-extractor@v2
- name: Log GAV - name: Log GAV
run: | run: |
echo ${{ steps.extract.outputs.group-id }} echo ${{ steps.extract.outputs.group-id }}

View File

@ -30,14 +30,14 @@ runs:
EVALUATE: org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate EVALUATE: org.apache.maven.plugins:maven-help-plugin:3.2.0:evaluate
run: | run: |
VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.groupId -q -DforceStdout) VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.groupId -q -DforceStdout)
echo "::set-output name=group-id::$VALUE" echo "group-id=$VALUE" >> $GITHUB_OUTPUT
VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.artifactId -q -DforceStdout) VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.artifactId -q -DforceStdout)
echo "::set-output name=artifact-id::$VALUE" echo "artifact-id=$VALUE" >> $GITHUB_OUTPUT
VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.version -q -DforceStdout) VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.version -q -DforceStdout)
echo "::set-output name=version::$VALUE" echo "version=$VALUE" >> $GITHUB_OUTPUT
VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.name -q -DforceStdout) VALUE=$(mvn -f ${{ inputs.pom-location }} $EVALUATE -Dexpression=project.name -q -DforceStdout)
echo "::set-output name=name::$VALUE" echo "name=$VALUE" >> $GITHUB_OUTPUT
shell: bash shell: bash