Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
kiddin9 committed Dec 29, 2022
1 parent cd5ca1b commit bb64cd0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 40 deletions.
41 changes: 21 additions & 20 deletions .github/workflows/Packages-AutoBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:

jobs:
build:
if: github.event.repository.owner.id == github.event.sender.id
if: github.event.repository.owner.id == github.event.sender.id || github.event.sender.id == '119362912'
runs-on: Ubuntu-22.04

name: Build ${{matrix.target}}
Expand All @@ -43,13 +43,6 @@ jobs:
with:
fetch-depth: 0

- name: cancel running workflows
uses: styfle/cancel-workflow-action@main
if: contains(github.event.action, 'cw')
with:
workflow_id: Packages-AutoBuild.yml
access_token: ${{ github.token }}

- name: Load Settings.ini
run: |
source "${GITHUB_WORKSPACE}/devices/common/settings.ini"
Expand All @@ -64,17 +57,22 @@ jobs:
echo "UPLOAD_FIRMWARE_FOR_RELEASE=${UPLOAD_FIRMWARE_FOR_RELEASE}" >> $GITHUB_ENV
echo "UPLOAD_FIRMWARE_TO_COWTRANSFER=${UPLOAD_FIRMWARE_TO_COWTRANSFER}" >> $GITHUB_ENV
echo "UPLOAD_FIRMWARE_TO_WETRANSFER=${UPLOAD_FIRMWARE_TO_WETRANSFER}" >> $GITHUB_ENV
sed -i "1a REPO_TOKEN=${{ secrets.REPO_TOKEN }}" ${GITHUB_WORKSPACE}/devices/common/custom.sh
sed -i "1a REPO_TOKEN=${{ env.REPO_TOKEN }}" ${GITHUB_WORKSPACE}/devices/common/custom.sh
if [[ "${{matrix.target}}" == arm_* ]]; then
echo "REPO_TOKEN=${{ secrets.REPO_TOKEN }}" >> $GITHUB_ENV
else
echo "REPO_TOKEN=${{ secrets.REPO_TOKEN2 }}" >> $GITHUB_ENV
fi
- name: Trigger Packages Update
run: |
gitdate=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at')
gitdate=$(date -d "$gitdate" +%s)
now=$(date -d "$(date)" +%s)
gitdate="$(curl -H "Authorization: token ${{ env.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at')" || true
gitdate="$(date -d "$gitdate" +%s)" || true
now="$(date -d "$(date)" +%s)"
if [[ $(expr $gitdate + 120) < $now ]]; then
curl -X POST https://api.github.com/repos/kiddin9/openwrt-packages/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ secrets.REPO_TOKEN_kiddin9 }}" \
--data '{"event_type": "update"}'
fi
Expand All @@ -100,7 +98,7 @@ jobs:
- name: Clone source code
run: |
#REPO_BRANCH="$(curl -s https://api.github.com/repos/openwrt/openwrt/tags | jq -r '.[].name' | grep v22 | head -n 1 | sed -e 's/v//')"
#REPO_BRANCH="$(curl -s https://api.github.com/repos/openwrt/openwrt/tags | jq -r '.[].name' | grep v22 | head -n 1 | sed -e 's/v//')" || true
REPO_BRANCH="22.03-SNAPSHOT"
if [ ${{matrix.target}} == "mipsel_24kc" ]; then
curl -fL -m 150 -o sdk.tar.xz https://downloads.openwrt.org/releases/$REPO_BRANCH/targets/ramips/mt7621/openwrt-sdk-$REPO_BRANCH-ramips-mt7621_gcc-11.2.0_musl.Linux-x86_64.tar.xz || curl -fL -m 150 -o sdk.tar.xz https://downloads.cdn.openwrt.org/releases/$REPO_BRANCH/targets/ramips/mt7621/openwrt-sdk-$REPO_BRANCH-ramips-mt7621_gcc-11.2.0_musl.Linux-x86_64.tar.xz
Expand Down Expand Up @@ -189,7 +187,7 @@ jobs:
mv -f feeds/packages/lang feeds/packages/lang.b
mv -f feeds/packages feeds/packages.b
mkdir package/feeds/kiddin9
cp -rf kiddin9.b/{wxbase,lib*,rapidjson,jpcre2,toml11,quickjspp,qtbase,qttools,rblibtorrent,openssl} package/feeds/kiddin9/
cp -rf kiddin9.b/{wxbase,lib*,rapidjson,jpcre2,toml11,quickjspp,qtbase,qttools,rblibtorrent,openssl,mbedtls,ppp} package/feeds/kiddin9/
- name: Compile the firmware
run: |
Expand Down Expand Up @@ -217,13 +215,14 @@ jobs:
if [[ "$fpkg" && ! "$during" ]]; then
comp
else
gitdate=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/commits?path=$ipk&per_page=1" | jq -r '.[0].commit.committer.date') || true
gitdate="$(curl -H "Authorization: token ${{ env.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/commits?path=$ipk&per_page=1" | jq -r '.[0].commit.committer.date')" || true
if [ "$gitdate" != null ]; then
gitdate=$(date -d "$gitdate" +%s)
now=$(date -d "$(date)" +%s)
gitdate="$(date -d "$gitdate" +%s)"
now="$(date -d "$(date)" +%s)"
[ "$during" ] || during="1.05"
durings=`echo "$during*60*60*24" | bc`
if [[ $(($gitdate + ${durings%.*})) -gt $now ]]; then
echo "$((($now - $gitdate)/60/60))" || true
comp
fi
fi
Expand Down Expand Up @@ -287,7 +286,7 @@ jobs:
continue-on-error: true
if: env.REPO_TOKEN && env.UPLOAD_FIRMWARE_FOR_RELEASE == 'true'
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN_kiddin9 }}
with:
files: |
${{ env.FIRMWARE }}/*
Expand All @@ -313,6 +312,7 @@ jobs:
SOURCE: "packages/"
REMOTE_HOST: op.supes.top
REMOTE_USER: root
REMOTE_PORT: '223'
TARGET: "/www/wwwroot/op.supes.top/packages/${{matrix.target}}/"

- name: remote ssh command
Expand All @@ -321,6 +321,7 @@ jobs:
with:
host: op.supes.top
username: root
port: 223
key: ${{ env.SSH_PRIVATE_KEY }}
script: |
# cp -R /www/wwwroot/op.supes.top/packages/keep/common/* /www/wwwroot/op.supes.top/packages/${{matrix.target}}/
Expand All @@ -342,4 +343,4 @@ jobs:
keep_latest: 100
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN_kiddin9 }}
40 changes: 20 additions & 20 deletions .github/workflows/repo-dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
default: ''

env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN_kiddin9 }}
TZ: Asia/Shanghai

jobs:
Expand All @@ -34,14 +34,14 @@ jobs:
steps:
- name: cancel running workflows
uses: styfle/cancel-workflow-action@main
if: contains(${{ github.event.inputs.packages }}, 'cw')
if: contains(github.event.inputs.packages, ' cw')
with:
workflow_id: Packages-AutoBuild.yml
workflow_id: all
access_token: ${{ github.token }}

- name: Trigger matrix Update
run: |
gitdate=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/commits?&per_page=1" | jq -r '.[0].commit.committer.date')
gitdate=$(curl -H "Authorization: token ${{ env.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/commits?&per_page=1" | jq -r '.[0].commit.committer.date') || true
fpkg="$(echo "${{github.event.action}}" | sed -e 's/\(aarch64_generic\|x86_64\|i386_pentium4\|arm_arm1176jzf-s_vfp\|aarch64_cortex-a72\|arm_cortex-a7_neon-vfpv4\|arm_cortex-a9\|arm_cortex-a15_neon-vfpv4\|arm_cortex-a5_vfpv4\|mipsel_24kc\|mips_24kc\|aarch64_cortex-a53\|arm_xscale\|arm_cortex-a9_vfpv3-d16\| [0-9][0-9.]*\| ssh\| noser\| cw\)//g' | sed -e 's/ //g')"
during="$(echo "${{github.event.inputs.packages}}" | grep -o -E ' [0-9][0-9.]*' | sed -e 's/ //')"
[[ "$fpkg" && ! "$during" ]] || {
Expand All @@ -54,84 +54,84 @@ jobs:
if [[ $(expr $gitdate + ${durings%.*}) -lt $now ]]; then
exit;
fi
gitdate=$(curl -H "Authorization: token ${{ secrets.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at')
gitdate=$(curl -H "Authorization: token ${{ env.REPO_TOKEN }}" -s "https://api.github.com/repos/kiddin9/openwrt-packages/actions/runs" | jq -r '.workflow_runs[0].created_at') || true
gitdate=$(date -d "$gitdate" +%s)
now=$(date -d "$(date)" +%s)
if [[ $(expr $gitdate + 180) < $now ]]; then
curl -X POST https://api.github.com/repos/kiddin9/openwrt-packages/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
--data '{"event_type": "update"}'
fi
}
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "x86_64 ${{ github.event.inputs.packages }}", "client_payload": {"target": "x86_64"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "i386_pentium4 ${{ github.event.inputs.packages }}", "client_payload": {"target": "i386_pentium4"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "aarch64_generic ${{ github.event.inputs.packages }}", "client_payload": {"target": "aarch64_generic"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_arm1176jzf-s_vfp ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_arm1176jzf-s_vfp"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_cortex-a5_vfpv4 ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_cortex-a5_vfpv4"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "aarch64_cortex-a72 ${{ github.event.inputs.packages }}", "client_payload": {"target": "aarch64_cortex-a72"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "aarch64_cortex-a53 ${{ github.event.inputs.packages }}", "client_payload": {"target": "aarch64_cortex-a53"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "mipsel_24kc ${{ github.event.inputs.packages }}", "client_payload": {"target": "mipsel_24kc"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "mips_24kc ${{ github.event.inputs.packages }}", "client_payload": {"target": "mips_24kc"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_cortex-a7_neon-vfpv4 ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_cortex-a7_neon-vfpv4"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_cortex-a9 ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_cortex-a9"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_cortex-a9_vfpv3-d16 ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_cortex-a9_vfpv3-d16"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_cortex-a15_neon-vfpv4 ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_cortex-a15_neon-vfpv4"}}'
curl \
-X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.REPO_TOKEN }}" \
-H "Authorization: token ${{ env.REPO_TOKEN }}" \
-d '{"event_type": "arm_xscale ${{ github.event.inputs.packages }}", "client_payload": {"target": "arm_xscale"}}'

0 comments on commit bb64cd0

Please sign in to comment.