Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,16 @@ jobs:
git diff --cached --quiet && exit 0
git commit -m "Auto generate build.py"
git push origin HEAD:${GITHUB_REF#refs/heads/}

archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- name: Gradle createSourceZip
run: chmod +x gradlew && ./gradlew createSourceZip --no-daemon
31 changes: 31 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,34 @@ tasks.register("clean", Delete) {
description = "Deletes the build/ directory"
delete(layout.buildDirectory)
}


// ---------------------------------------------------------------------
// createSourceArchive: Copies project files into the archive directory, excluding .git
// ---------------------------------------------------------------------
tasks.register('createSourceArchive', Copy) {
description = 'Copies project files into the archive directory, excluding .git'
from(rootDir) {
exclude 'archive/**'
exclude '.github/**'
exclude '.git/**'
}
into layout.buildDirectory.dir('archive/source')
}

tasks.register('copyGitHistory', Copy) {
description = 'Copies git history into the archive directory'
dependsOn createSourceArchive
from(rootDir) {
include '.git/**'
}
into layout.buildDirectory.dir('archive/source')
}

tasks.register('createSourceZip', Zip) {
description = 'Creates source-with-history.zip'
dependsOn copyGitHistory
from layout.buildDirectory.dir('archive/source')
archiveFileName = 'source-with-history.zip'
destinationDirectory = layout.buildDirectory.dir('archive')
}