-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: publish dependencies | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
publish-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: eclipse-edc/.github/.github/actions/setup-build@main | ||
- name: Download latest Eclipse Dash | ||
run: | | ||
curl -L https://repo.eclipse.org/service/local/artifact/maven/redirect\?r\=dash-licenses\&g\=org.eclipse.dash\&a\=org.eclipse.dash.licenses\&v\=LATEST --output dash.jar | ||
- name: Generate DEPENDENCIES | ||
run: | | ||
./gradlew allDependencies | grep -Poh "(?<=\s)[\w.-]+:[\w.-]+:[^:\s\[\]]+" | sort | uniq | java -jar dash.jar - -summary DEPENDENCIES || true | ||
if [ -s DEPENDENCIES ]; | ||
then | ||
# log warning if restricted deps are found | ||
grep -E 'restricted' DEPENDENCIES > RESTRICTED | ||
if [ -s RESTRICTED ]; | ||
echo "warning: restricted dependencies found:" | ||
cat RESTRICTED | ||
fi | ||
grep -E 'rejected' DEPENDENCIES > REJECTED | ||
if [ -s REJECTED ]; | ||
echo "error: rejected dependencies found:" | ||
cat REJECTED | ||
exit 1 | ||
fi | ||
mkdir public | ||
mv DEPENDENCIES public/ | ||
|
||
else | ||
echo "error: DEPENDENCIES file was not created correctly, please trigger the workflow again" | ||
exit 1 | ||
fi | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: public | ||
keep_files: true | ||
|
||
Post-To-Discord: | ||
needs: [ publish-dependencies ] | ||
if: "failure()" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: sarisia/actions-status-discord@v1 | ||
with: | ||
webhook: ${{ secrets.DISCORD_GITHUB_CI_WEBHOOK }} | ||
status: ${{ needs.publish-dependencies.result }} | ||
title: "Generate ${{ github.repository }} dependencies" | ||
username: GitHub Actions |