Skip to content

Commit e0a7974

Browse files
committed
Move info.json changes into a bash script.
1 parent ba9b9a5 commit e0a7974

File tree

3 files changed

+45
-16
lines changed

3 files changed

+45
-16
lines changed

.github/actions/release-plugin/action.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,7 @@ runs:
8989
- id: generate-info-json
9090
name: Fetch and update info.json for WPE release
9191
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
92+
./scripts/add-wpe-version-info-file.sh ${{ env.VERSION }}
10893
echo "info-json-path=$PWD/info.json" >> $GITHUB_ENV
10994
shell: bash
11095

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
VERSION=$1
3+
4+
curl -sSL "https://wpe-plugin-updates.wpengine.com/faustwp/info.json" -o info.json
5+
current_time=$(date -u +"%Y-%m-%d %-I:%M%p GMT")
6+
download_link="https://wpe-plugin-updates.wpengine.com/faustwp/faustwp.${VERSION}.zip"
7+
8+
# Update the info.json file with the new version and download link
9+
jq \
10+
--arg version "$VERSION" \
11+
--arg last_updated "$current_time" \
12+
--arg download_link "$download_link" \
13+
--arg new_version "$VERSION" \
14+
--arg new_download_link "https://wpe-plugin-updates.wpengine.com/faustwp/faustwp.${VERSION}.zip" \
15+
'.versions = {($new_version): $new_download_link} + .versions | .version=$version | .last_updated=$last_updated | .download_link=$download_link' \
16+
info.json > info.json.tmp && mv info.json.tmp info.json

.github/workflows/debug.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Fetch, Modify, and Output info.json
2+
3+
on:
4+
push:
5+
branches:
6+
- bug-fix-github-workflow-faustwp-issues
7+
8+
jobs:
9+
fetch_modify_info_json:
10+
name: Fetch, Modify, and Output info.json
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Fetch info.json
17+
run: |
18+
curl -sSL "https://wpe-plugin-updates.wpengine.com/faustwp/info.json" -o info.json
19+
20+
- name: Fetch and update info.json for WPE release
21+
run: |
22+
./scripts/add-wpe-version-info-file.sh ${{ env.VERSION }}
23+
shell: bash
24+
25+
- name: Output modified info.json
26+
run: |
27+
echo "Modified info.json content:"
28+
cat info.json

0 commit comments

Comments
 (0)