Skip to content

Commit

Permalink
fix: attach cli artifact to release (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Becker <[email protected]>
  • Loading branch information
sbckr committed Aug 4, 2023
1 parent 5729093 commit 50aa988
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/java.publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- name: Retrieve license obligation resources
id: license-obligations
run: |
mkdir -p license-obligations
cd 3RD-PARTY-LICENSES
FILES=$(find . -maxdepth 1 -type d -not -path .)
if [ -n "$FILES" ]
Expand All @@ -29,25 +30,11 @@ jobs:
split($0,b,"/"); \
system("xargs < " $0 " curl --create-dirs -Lo ./sources/" b[2] ".zip " $2)}' && \
find -regex './sources$' | awk '{system("zip -jr ./3rd-party-sources.zip " $0)}'
mkdir -p ../license-obligations
ARCHIVES=$(find . -regex "^./3rd-party-.*.zip$")
OBLIGATIONS_FOUND="false"
if [ -n "$ARCHIVES" ]
then
mv $(echo "${ARCHIVES}") ../license-obligations/
OBLIGATIONS_FOUND="true"
fi
echo "OBLIGATIONS_FOUND=${OBLIGATIONS_FOUND}" >> $GITHUB_OUTPUT
- name: Update Release with license obligations resources
uses: ncipollo/release-action@v1
if: steps.license-obligations.outputs.OBLIGATIONS_FOUND == 'true'
with:
allowUpdates: true
artifacts: license-obligations/*
artifactErrorsFailBuild: true
makeLatest: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Setup java
uses: actions/setup-java@v3
with:
Expand All @@ -64,5 +51,18 @@ jobs:
"username": "${{ secrets.GHPR_USERNAME }}",
"password": "${{ secrets.GHPR_TOKEN }}"
}]
- name: Build artifact
run: |
mvn package -Dskip.tests --batch-mode --no-transfer-progress &&
cp target/cli-${GITHUB_REF#refs/*/cli-v}-jar-with-dependencies.jar cli-${GITHUB_REF#refs/*/cli-v}.jar
- name: Update Release with license obligations resources
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: license-obligations/*,cli-${GITHUB_REF#refs/*/cli-v}.jar
artifactErrorsFailBuild: true
makeLatest: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Publish version to GitHub Packages
run: mvn deploy -Dskip.tests --batch-mode --no-transfer-progress

0 comments on commit 50aa988

Please sign in to comment.