Skip to content

Commit

Permalink
[CARD-45] Further workflow testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jrsmth-tier2 committed Mar 12, 2024
1 parent a49c9e6 commit a7672be
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/step-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 🏷️
Expand All @@ -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

0 comments on commit a7672be

Please sign in to comment.