diff --git a/.github/workflows/step-release.yaml b/.github/workflows/step-release.yaml index c6bd800..2769214 100644 --- a/.github/workflows/step-release.yaml +++ b/.github/workflows/step-release.yaml @@ -12,13 +12,12 @@ jobs: uses: fregante/setup-git-user@v2 - name: Retrieve Version 🔍 run: | - cat gradle.properties | jq -R -s 'split("\n") | map(select(length > 0)) | map(select(startswith("#") | not)) | map(split("=")) | map({(.[0]): .[1]}) | add' >> gradle.json + cat gradle.properties | jq -R -s 'split("\n") | map(select(length > 0)) | map(select(startswith("#") | not)) | map(split("=")) | map({(.[0]): .[1]}) | add' > gradle.json echo "RELEASE_VERSION=$(cat gradle.json | jq -r '.version' | cut -d '-' -f1)" >> $GITHUB_ENV echo "MAJOR=$(cat gradle.json | jq -r '.version' | cut -d "." -f 1)" >> $GITHUB_ENV echo "MINOR=$(cat gradle.json | jq -r '.version' | cut -d "." -f 2)" >> $GITHUB_ENV echo "PATCHED=$((1 + $(cat gradle.json | jq -r '.version' | cut -d "." -f 3) ))" >> $GITHUB_ENV - rm gradle.properties - jq -r 'to_entries[]|"\(.key)=\(.value)"' gradle.json >> gradle.properties + jq -r 'to_entries[]|"\(.key)=\(.value)"' gradle.json > gradle.properties rm gradle.json # Note :: an env var cannot be accessed from a step that defines or updates it - name: Bump and Tag 🏷️ @@ -31,10 +30,10 @@ jobs: tag_name: ${{ env.RELEASE_VERSION }} - name: Add -SNAPSHOT 📷 run: | - cat gradle.properties | jq -R -s 'split("\n") | map(select(length > 0)) | map(select(startswith("#") | not)) | map(split("=")) | map({(.[0]): .[1]}) | add' >> gradle.json + cat gradle.properties | jq -R -s 'split("\n") | map(select(length > 0)) | map(select(startswith("#") | not)) | map(split("=")) | map({(.[0]): .[1]}) | add' > gradle.json jq '.version="${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCHED }}-SNAPSHOT"' gradle.json > /tmp/gradle.json - rm gradle.properties - jq -r 'to_entries[]|"\(.key)=\(.value)"' gradle.json >> gradle.properties + jq -r 'to_entries[]|"\(.key)=\(.value)"' /tmp/gradle.json > /tmp/gradle.properties rm gradle.json + rm /tmp/gradle.json - name: Commit -SNAPSHOT 💾 uses: stefanzweifel/git-auto-commit-action@v4