Allow for separate recipe name and location #25
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
name: Convert recipes flow | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build-gradle-project: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v3 | |
with: | |
path: main | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Initialize mandatory git config | |
run: | | |
cd main | |
git config user.name "GitHub Actions" | |
git config user.email [email protected] | |
- name: Checkout and run build converter tool | |
run: | | |
ls | |
cd main | |
git fetch --all --depth=1 | |
cd convert-tool | |
./gradlew standaloneJar | |
echo "Built converter" | |
cd .. | |
- name: Convert recipes | |
run: | | |
cd main | |
grep -v "^#" version_mappings.txt | while read line | |
do | |
versions=(${line//;/ }) | |
AGP=${versions[0]} | |
GRADLE=${versions[1]} | |
echo "Converting for AGP $AGP with Gradle $GRADLE" | |
BRANCH="agp-" | |
BRANCH+=${AGP:0:3} | |
BRANCH_DIR="../$BRANCH" | |
echo "Working on branch $BRANCH in $BRANCH_DIR" | |
mkdir $BRANCH_DIR | |
cp -r .git "$BRANCH_DIR/.git" | |
java -jar convert-tool/app/build/libs/recipes-converter-all.jar \ | |
--action convert --sourceAll recipes \ | |
--destination "$BRANCH_DIR" \ | |
--agpVersion "$AGP" --gradleVersion "$GRADLE" --overwrite | |
echo "Converted recipes" | |
cd $BRANCH_DIR | |
find . -name gradlew | xargs chmod +x | |
git branch $BRANCH origin/${GITHUB_REF##*/} || git branch $BRANCH | |
git reset $BRANCH | |
git checkout $BRANCH | |
git add -A | |
echo "Ready for commit" | |
git commit --message "Prepare release" || echo "Nothing to commit" | |
git push -f --set-upstream origin $BRANCH | |
echo "Done for $BRANCH" | |
cd ../main | |
done | |
cd .. |