@@ -16,6 +16,9 @@ outputs:
1616 org-zip-path :
1717 description : ' Path to .org zip file'
1818 value : ${{ steps.zip-org-release-for-github.outputs.zip-path }}
19+ info-json-path :
20+ description : ' Path to info.json file'
21+ value : ${{ steps.generate-info-json.outputs.info-json-path }}
1922
2023runs :
2124 using : ' composite'
8285 asset_name : faustwp.${{ env.VERSION }}.org.zip
8386 tag_name : canary
8487 overwrite : true
88+
89+ - id : generate-info-json
90+ name : Fetch and update info.json for WPE release
91+ run : |
92+ # Fetch the info.json file and set variables
93+ curl -sSL "https://wpe-plugin-updates.wpengine.com/faustwp/info.json" -o info.json
94+ current_time=$(date -u +"%Y-%m-%d %-I:%M%p GMT")
95+ download_link="https://wpe-plugin-updates.wpengine.com/faustwp/faustwp.${{ env.VERSION }}.zip"
96+
97+ # Update the info.json file with the new version and download link
98+ jq \
99+ --arg version "${{ env.VERSION }}" \
100+ --arg last_updated "$current_time" \
101+ --arg download_link "$download_link" \
102+ --arg new_version "${{ env.VERSION }}" \
103+ --arg new_download_link "https://wpe-plugin-updates.wpengine.com/faustwp/faustwp.${{ env.VERSION }}.zip" \
104+ '.versions = {($new_version): $new_download_link} + .versions | .version=$version | .last_updated=$last_updated | .download_link=$download_link' \
105+ info.json > info.json.tmp && mv info.json.tmp info.json
106+
107+ # Output the modified file path
108+ echo "info-json-path=$PWD/info.json" >> $GITHUB_ENV
109+ shell : bash
110+
111+ - id : upload-info-json-to-github
112+ name : Upload info.json to GitHub Releases
113+ uses : softprops/action-gh-release@v2
114+ with :
115+ token : ${{ inputs.github_token }}
116+ files : ${{ env.info-json-path }}
117+ asset_name : info.json
118+ tag_name : canary
119+ overwrite : true
0 commit comments