Skip to content

Commit

Permalink
fix: attach cli artifact to release
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 0dcc46e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 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,21 +30,36 @@ 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: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'maven'
- name: Setting up Github Package Repository as Maven Repository
uses: s4u/[email protected]
with:
githubServer: false
servers: |
[{
"id": "github",
"username": "${{ github.actor }}",
"password": "${{ secrets.GITHUB_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
if: steps.license-obligations.outputs.OBLIGATIONS_FOUND == 'true'
with:
allowUpdates: true
artifacts: license-obligations/*
artifacts: license-obligations/*,cli-${GITHUB_REF#refs/*/cli-v}.jar
artifactErrorsFailBuild: true
makeLatest: true
omitBodyDuringUpdate: true
Expand Down

0 comments on commit 0dcc46e

Please sign in to comment.