Skip to content

Commit 52e89b1

Browse files
committed
feat: initialize Gradle Dependency Bundle project with core components, example usage, and audit CLI
0 parents  commit 52e89b1

36 files changed

Lines changed: 2453 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
verify:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: "17"
20+
- uses: gradle/actions/setup-gradle@v4
21+
22+
- name: Unit tests and complete bundle
23+
run: ./gradlew --no-daemon --no-configuration-cache clean test verifyPreparedDependencyBundle :auditor-cli:jibDockerBuild
24+
25+
- name: Verify important artifact classes
26+
run: |
27+
repo="$PWD/build/dependency-bundle/m2/repository"
28+
test -n "$(find "$repo" -name 'kotlin-gradle-plugin-*.jar' -print -quit)"
29+
test -n "$(find "$repo" -name 'gradle-kotlin-dsl-plugins-*.jar' -print -quit)"
30+
test -n "$(find "$repo" -name 'kotlinpoet-jvm-*.jar' -print -quit)"
31+
test -n "$(find "$repo" -name '*-sources.jar' -print -quit)"
32+
test -n "$(find "$repo" -name '*.module' -print -quit)"
33+
34+
- name: Run independent example using only the bundle
35+
run: |
36+
mkdir -p build/offline-gradle-home
37+
cp -R build/dependency-bundle-gradle-home/wrapper build/offline-gradle-home/
38+
./gradlew --no-daemon -g build/offline-gradle-home -p example \
39+
-PbundleRepository="$PWD/build/dependency-bundle/m2/repository" \
40+
-PbundleOfflineOnly --offline clean run
41+
42+
- name: Build and inspect OCI image
43+
run: |
44+
image="ghcr.io/openprojectx/gradle-dependency-bundle:0.1.0-SNAPSHOT"
45+
container=$(docker create "$image")
46+
docker cp "$container:/m2/repository" build/image-repository
47+
docker cp "$container:/dependency-bundle/dependency-graph.json" build/image-dependency-graph.json
48+
docker rm "$container"
49+
test -n "$(find build/image-repository -name '*.jar' -print -quit)"

.github/workflows/publish-docs.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Docs
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Release
7+
types:
8+
- completed
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: github-pages
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build:
22+
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Checkout latest release tag
32+
if: ${{ github.event_name == 'workflow_run' }}
33+
run: |
34+
git fetch --tags --force
35+
latest_tag="$(git describe --tags --abbrev=0)"
36+
echo "Publishing docs from tag: $latest_tag"
37+
git checkout "$latest_tag"
38+
39+
- name: Set up Java
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: temurin
43+
java-version: "17"
44+
45+
- name: Set up Gradle
46+
uses: gradle/actions/setup-gradle@v4
47+
48+
- name: Build docs
49+
run: ./gradlew asciidoctor
50+
51+
- name: Upload Pages artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: build/docs
55+
56+
deploy:
57+
needs: build
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
63+
steps:
64+
- name: Deploy to GitHub Pages
65+
id: deployment
66+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
inputs:
9+
gradle_args:
10+
description: "Extra Gradle args for the release run, for example: --stacktrace --debug"
11+
required: false
12+
default: ""
13+
type: string
14+
15+
permissions:
16+
contents: write
17+
packages: write
18+
19+
concurrency:
20+
group: release-master
21+
cancel-in-progress: false
22+
23+
jobs:
24+
release:
25+
runs-on: ubuntu-latest
26+
if: >
27+
github.event_name != 'push' ||
28+
(
29+
github.actor != 'github-actions[bot]' &&
30+
!contains(github.event.head_commit.message, '[Gradle Release Plugin]')
31+
)
32+
33+
env:
34+
GRADLE_OPTS: -Dorg.gradle.daemon=false
35+
EXTRA_GRADLE_ARGS: ${{ github.event.inputs.gradle_args || '' }}
36+
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
43+
44+
- name: Set up JDK 17
45+
uses: actions/setup-java@v4
46+
with:
47+
distribution: temurin
48+
java-version: "17"
49+
50+
- name: Set up Gradle
51+
uses: gradle/actions/setup-gradle@v4
52+
with:
53+
cache-read-only: false
54+
55+
- name: Configure git
56+
run: |
57+
git config user.name "github-actions[bot]"
58+
git config user.email "github-actions[bot]@users.noreply.github.com"
59+
60+
- name: Log in to GitHub Container Registry
61+
uses: docker/login-action@v3
62+
with:
63+
registry: ghcr.io
64+
username: ${{ github.actor }}
65+
password: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- name: Write signing key
68+
env:
69+
SIGNING_KEY_ASC: ${{ secrets.SIGNING_KEY_ASC }}
70+
run: |
71+
printf '%s' "$SIGNING_KEY_ASC" > "$RUNNER_TEMP/signing-key.asc"
72+
73+
- name: Run release
74+
env:
75+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
76+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
77+
SIGNING_KEY_FILE: ${{ runner.temp }}/signing-key.asc
78+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
79+
run: |
80+
./gradlew --no-configuration-cache release $EXTRA_GRADLE_ARGS

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
*.iws
13+
*.iml
14+
*.ipr
15+
out/
16+
!**/src/main/**/out/
17+
!**/src/test/**/out/
18+
19+
### Kotlin ###
20+
.kotlin
21+
22+
### Eclipse ###
23+
.apt_generated
24+
.classpath
25+
.factorypath
26+
.project
27+
.settings
28+
.springBeans
29+
.sts4-cache
30+
bin/
31+
!**/src/main/**/bin/
32+
!**/src/test/**/bin/
33+
34+
### NetBeans ###
35+
/nbproject/private/
36+
/nbbuild/
37+
/dist/
38+
/nbdist/
39+
/.nb-gradle/
40+
41+
### VS Code ###
42+
.vscode/
43+
44+
### Mac OS ###
45+
.DS_Store
46+
/.idea/

0 commit comments

Comments
 (0)