mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-25 05:31:21 +00:00
* update schema * update wifi daemon * fix dynamic vlan * add firmware upload to S3 Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: Max Brenner <xamrennerb@gmail.com>
56 lines
3.1 KiB
YAML
56 lines
3.1 KiB
YAML
name: Build OpenWrt/uCentral images
|
|
|
|
on:
|
|
push:
|
|
branches: [ uCentral-* ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target: ['cig_wf188', 'cig_wf194c', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'linksys_e8450-ubi', 'linksys_ea8300', 'tplink_cpe210_v3', 'tplink_cpe510_v3', 'tplink_eap225_outdoor_v1', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447' ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build image for ${{ matrix.target }}
|
|
id: build
|
|
run: |
|
|
git config --global user.email "you@example.com"
|
|
git config --global user.name "Your Name"
|
|
make -j TARGET=${{ matrix.target }}
|
|
|
|
- name: Package and upload image for ${{ matrix.target }}
|
|
env:
|
|
GH_BUILD_USERNAME: ${{ secrets.GH_BUILD_USERNAME }}
|
|
GH_BUILD_PASSWORD: ${{ secrets.GH_BUILD_PASSWORD }}
|
|
ARTIFACTORY_USERNAME: cicd-indoor-main
|
|
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
|
AWS_S3_BUCKET_NAME: ucentral-ap-firmware
|
|
AWS_DEFAULT_OUTPUT: json
|
|
AWS_DEFAULT_REGION: us-east-1
|
|
AWS_ACCOUNT_ID: ${{ secrets.UCENTRAL_S3_ACCOUNT_ID }}
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.UCENTRAL_S3_ACCESS_KEY_SECRET }}
|
|
run: |
|
|
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
LOWERCASE_TARGET=`echo ${{ matrix.target }} | tr '[:upper:]' '[:lower:]'`
|
|
HASH=$(git rev-parse --short HEAD)
|
|
BASENAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$BRANCH-$HASH"
|
|
TAR_NAME="$BASENAME.tar.gz"
|
|
IMG_NAME="$BASENAME-upgrade.bin";
|
|
JSON_NAME="$BASENAME.json";
|
|
|
|
tar cfz "$TAR_NAME" -C openwrt/bin/targets/ .
|
|
curl -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "$TAR_NAME" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/"$TAR_NAME""
|
|
IMG_NAME="$(date +%Y%m%d)-$LOWERCASE_TARGET-$BRANCH-$HASH-upgrade.bin";
|
|
TIP_VERSION="$(grep DISTRIB_TIP= openwrt/tmp/openwrt_release | cut -d\' -f2)"
|
|
echo -e "{\n\t\"image\":\""${IMG_NAME}"\",\n\t\"revision\": \""${TIP_VERSION}"\",\n\t\"timestamp\":\""$(date +%s)"\",\n\t\"compatible\": \""${LOWERCASE_TARGET}"\"\n}" > latest-upgrade.json
|
|
[ -f openwrt/tmp/image-file ] && curl -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "openwrt/$(cat openwrt/tmp/image-file)" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/"$IMG_NAME""
|
|
[ -f openwrt/tmp/image-file ] && curl -u $GH_BUILD_USERNAME:$GH_BUILD_PASSWORD -T "latest-upgrade.json" "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/$LOWERCASE_TARGET/latest-upgrade.json"
|
|
|
|
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/octet-stream" "openwrt/$(cat openwrt/tmp/image-file)" "s3://$AWS_S3_BUCKET_NAME/$IMG_NAME"
|
|
[ -f openwrt/tmp/image-file ] && aws s3 cp --acl public-read --content-type "application/json" "latest-upgrade.json" "s3://$AWS_S3_BUCKET_NAME/$JSON_NAME"
|