Skip to content

Commit

Permalink
Revert "Fetch latest release JSON and create build info markdown file"
Browse files Browse the repository at this point in the history
This reverts commit 80e2744.
  • Loading branch information
AzimsTech committed Feb 9, 2025
1 parent 80e2744 commit 49d60ab
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,21 @@ jobs:
FILES="${{ env.files }}" \
DISABLED_SERVICES="${{ env.disabled_services }}"
- name: Fetch latest release JSON
id: fetch_release
- name: Write Build Info
run: |
LATEST_JSON=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/repos/OWNER/REPO/releases/latest)
echo "LATEST_JSON:"
echo "$LATEST_JSON"
ASSET_URL=$(echo "$LATEST_JSON" | jq -r '.assets[0].browser_download_url')
# If ASSET_URL is null, optionally set a default or exit with an error
if [ "$ASSET_URL" = "null" ]; then
echo "Warning: No asset found in the latest release." >&2
fi
echo "ASSET_URL=$ASSET_URL" >> $GITHUB_ENV
# Determine if scripts are used
scripts="${{ env.SCRIPT != '' && env.SCRIPT || 'false' }}"
disabled_services="${{ env.disabled_services != '' && env.disabled_services || 'false' }}"
packages="${{ env.packages != '' && env.packages || 'default' }}"
- name: Create build info markdown file
run: |
# Get the target directory and write build info
target_dir=$(find openwrt-imagebuilder-*/bin/targets/*/*/ -type d -print -quit)
echo "image_path=$target_dir" >> $GITHUB_ENV
# Get version code from profiles.json
version_code=$(grep -o '"version_code":"[^"]*"' $target_dir/profiles.json | awk -F: '{print $2}' | tr -d '"')
# Create build info markdown file
cat <<EOF > build_info.md
## πŸ’‘ Custom OpenWrt Build Information
Expand All @@ -171,10 +169,6 @@ jobs:
- **Version Code**: \`$version_code\`
- **UCI Defaults Scripts**: \`$scripts\`
-----
### πŸ”— Download Link
- **Latest Release Asset**: [Download](${{ env.ASSET_URL }})
-----
### πŸ” sha256sum
Expand Down

0 comments on commit 49d60ab

Please sign in to comment.