Skip to content

Commit

Permalink
fix: add-lime-repos: read arch from apk + minors; multi-arch-build: r…
Browse files Browse the repository at this point in the history
…ename openwrt_branch_path
  • Loading branch information
a-gave committed Nov 22, 2024
1 parent 7ed75ba commit 01c15f0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/multi-arch-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
&& echo "snapshots/packages" || echo "releases/packages-$version")
echo $VERSION_PATH
OUTPUT_PATH=$([ "$version" == "main" ] \
OPENWRT_BRANCH_PATH=$([ "$version" == "main" ] \
&& echo "openwrt_main" || echo "openwrt_$version")
echo $OUTPUT_PATH
echo $OPENWRT_BRANCH_PATH
wget -r -nH --no-parent --level 1 --accept html -P. \
--directory-prefix=. https://downloads.openwrt.org/$VERSION_PATH/
Expand All @@ -69,7 +69,7 @@ jobs:
[[ $FIRST_BUILD -ne 1 ]] && JSON="$JSON"','
FIRST_BUILD=0
JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "output_path": "'"$OUTPUT_PATH"'" }'
JSON="$JSON"'{"version": "'"$VERSION"'" ,"arch": "'"$arch"'", "openwrt_branch_path": "'"$OPENWRT_BRANCH_PATH"'" }'
echo $JSON
done
done
Expand All @@ -87,8 +87,8 @@ jobs:
matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }}
# matrix:
# include:
# - { version: main, arch: x86_64, output_path: 'openwrt_main'}
# - { version: main, arch: arc_archs, output_path: 'openwrt_main'}
# - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'}
# - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -123,8 +123,8 @@ jobs:
matrix: ${{ fromJson(needs.generate_matrix.outputs.matrix_builds) }}
# matrix:
# include:
# - { version: main, arch: x86_64, output_path: 'openwrt_main'}
# - { version: main, arch: arc_archs, output_path: 'openwrt_main'}
# - { version: main, arch: x86_64, openwrt_branch_path: 'openwrt_main'}
# - { version: main, arch: arc_archs, openwrt_branch_path: 'openwrt_main'}
steps:
- uses: actions/checkout@v4

Expand All @@ -139,4 +139,4 @@ jobs:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: libremesh/lime-feed
publish_dir: ./artifacts/
destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.output_path }}/${{ matrix.arch }}/
destination_dir: arch_packages/${{ env.DEST_DIR }}/${{ matrix.openwrt_branch_path }}/${{ matrix.arch }}/
22 changes: 10 additions & 12 deletions packages/lime-system/files/etc/uci-defaults/92_add-lime-repos
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
feeds_file='/etc/apk/repositories.d/limefeeds.list'
dist_feeds_file='/etc/apk/repositories.d/distfeeds.list'
main_feed_path='apk/'
arch="$(cat /etc/apk/arch)"
} || ([ -f /etc/opkg/distfeed.conf ] && {
repo='opkg'
feeds_file='/etc/opkg/limefeeds.conf'
dist_feeds_file='/etc/opkg/distfeeds.conf'
main_feed_path=''
arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')"
key_name="a71b3c8285abd28b"
key_content="RWSnGzyChavSiyQ+vLk3x7F0NqcLa4kKyXCdriThMhO78ldHgxGljM/8"
})
Expand All @@ -29,10 +31,7 @@
exit 0;
}

arch="$(grep OPENWRT_ARCH /etc/os-release | sed 's/OPENWRT_ARCH=\"\(.*\)\"/\1/')"

openwrt_branch_ref="$(grep -m 1 "openwrt.org/" $dist_feeds_file | sed 's|.*openwrt.org/\(.*\)|\1|' )"
echo $openwrt_branch_ref

if [ '' != "$openwrt_branch_ref" ]; then
$(echo $openwrt_branch_ref | grep -q 'snapshots') && {
Expand All @@ -47,25 +46,24 @@ fi

[ "$LIME_CODENAME" == "development" ] && {
packages_url="http://feed.libremesh.org/${main_feed_path}master";
arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch/";
arch_packages_url="http://feed.libremesh.org/arch_packages/master/$openwrt_branch/$arch";
} || {
packages_url="http://feed.libremesh.org/${main_feed_path}$LIME_RELEASE"
arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch/";
arch_packages_url="http://feed.libremesh.org/arch_packages/$LIME_RELEASE/$openwrt_branch/$arch";
}

profiles_url="http://feed.libremesh.org/${main_feed_path}profiles"

echo "Configuring official LibreMesh $repo feeds"
[ $repo == 'apk' ] && {
echo "$packages_url/packages.adb" > "$feeds_file"
echo "${arch_packages_url}/packages.adb" >> "$feeds_file"
echo "$profiles_url/packages.adb" >> "$feeds_file"
} || (
[ $repo == 'opkg' ] && {
echo "src/gz libremesh $packages_url" > "$feeds_file"
echo "src/gz libremesh_arch_packages $arch_packages_url" >> "$feeds_file"
echo "src/gz profiles $profiles_url" >> "$feeds_file"
echo "untrusted comment: signed by libremesh.org key $key_name" > "/etc/opkg/keys/$key_name"
echo "$key_content" >> "/etc/opkg/keys/$key_name"
}
[ $repo == 'apk' ] && {
proto=https
echo "$packages_url/packages.adb" > "$feeds_file"
echo "${arch_packages_url}packages.adb" >> "$feeds_file"
echo "$profiles_url/packages.adb" >> "$feeds_file"
}
})

0 comments on commit 01c15f0

Please sign in to comment.