Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

using actions to publish java artefact to maven central

Hi!

 

I would like to release a library (navikt/bidrag-commons) to maven central and need to write a ci/cd pipeline.

 

I am searching for an example or an instruction of how to do that using github actions, but am struggeling to find good sources.

 

Is it possible to write an easy step-by-step instruction of how to accomplish this?

1 Reply
Copilot Lvl 2
Message 2 of 2

Re: using actions to publish java artefact to maven central

first:

 

the user guide says that action files must be *.yml OR *.yaml.

it fails if the file is named action.yaml. which is too bad as i because i prefer yaml over yml...

 

second:

there is no examples of how an action file is supposed to look like (except short snippets of code which does not explain all properties). my action fails when i try to run maven via docker.

my action file: https://github.com/navikt/bidrag-commons/blob/feature-actions/.github/actions/maven-ci/action.yml

 

the error message:

 
##[error](Line: 18, Col: 7): Unexpected value 'docker run -it -rm --name ${ inputs.artifact} -v ${ inputs.workpath }:/usr/src/maven ${ inputs.image } mvn -B package'
3##[error](Line: 18, Col: 7): Unrecognized named-value: 'inputs'. Located at position 1 within expression: inputs.artifact
4##[error](Line: 18, Col: 7): Unexpected value 'docker run -it -rm --name ${{ inputs.artifact}} -v ${{ inputs.workpath }}:/usr/src/maven ${{ inputs.image }} mvn -B package'
5##[error]Unexpected type 'StringToken' encountered while reading 'runs'. The type 'MappingToken' was expected.
6##[error]Fail to load /home/runner/work/bidrag-commons/bidrag-commons/./.github/actions/maven-ci/action.yml
 
why cannot github find the inputs object? what is a 'StringToken' and 'MappingToken'?