92 lines
3.4 KiB
YAML
Vendored
92 lines
3.4 KiB
YAML
Vendored
name: Archive Example Projects
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'examples/android-example/**'
|
|
- 'examples/kotlin-dataframe-plugin-gradle-example/**'
|
|
- 'examples/kotlin-dataframe-plugin-maven-example/**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-archives:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Create archives in temp directory
|
|
run: |
|
|
mkdir -p /tmp/archives
|
|
|
|
cd examples/android-example
|
|
zip -r /tmp/archives/android-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*"
|
|
|
|
cd ../kotlin-dataframe-plugin-gradle-example
|
|
zip -r /tmp/archives/kotlin-dataframe-plugin-gradle-example.zip . -x "*.git*" "build/*" ".gradle/*" "*/build/*" ".idea/*"
|
|
|
|
cd ../kotlin-dataframe-plugin-maven-example
|
|
zip -r /tmp/archives/kotlin-dataframe-plugin-maven-example.zip . -x "*.git*" "target/*" ".idea/*"
|
|
|
|
- name: Checkout example-projects-archives branch
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
if git ls-remote --exit-code --heads origin example-projects-archives; then
|
|
git fetch origin example-projects-archives
|
|
git checkout example-projects-archives
|
|
else
|
|
git checkout --orphan example-projects-archives
|
|
git rm -rf .
|
|
fi
|
|
|
|
- name: Update archives
|
|
run: |
|
|
git rm -f *.zip 2>/dev/null || true
|
|
|
|
cp /tmp/archives/*.zip .
|
|
|
|
CURRENT_DATE=$(date -u '+%Y-%m-%d %H:%M UTC')
|
|
|
|
cat > README.md << EOF
|
|
# Kotlin DataFrame - Example Projects Archives
|
|
|
|
Automatically generated archives of example projects.
|
|
|
|
## Available archives:
|
|
|
|
### Android Example
|
|
Example of using Kotlin DataFrame in an Android application.
|
|
|
|
**Download:** [android-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/android-example.zip)
|
|
|
|
### Kotlin DataFrame Plugin Gradle Example
|
|
Example of using the compiler plugin for Kotlin DataFrame in Gradle project.
|
|
|
|
**Download:** [kotlin-dataframe-plugin-gradle-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-gradle-example.zip)
|
|
|
|
### Kotlin DataFrame Plugin Maven Example
|
|
Example of using the compiler plugin for Kotlin DataFrame in Gradle project.
|
|
|
|
**Download:** [kotlin-dataframe-plugin-maven-example.zip](https://github.com/Kotlin/dataframe/raw/example-projects-archives/kotlin-dataframe-plugin-maven-example.zip)
|
|
|
|
---
|
|
|
|
Last updated: $CURRENT_DATE
|
|
|
|
Source commit: ${{ github.sha }}
|
|
EOF
|
|
|
|
git add .
|
|
git commit -m "Update example archives from ${{ github.sha }}" || echo "No changes to commit"
|
|
|
|
- name: Push to example-projects-archives branch
|
|
run: |
|
|
git push -f origin example-projects-archives
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|