mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-12-06 03:26:45 +03:00
Merge branch 'dev'
This commit is contained in:
54
.github/workflows/build-ci.yml
vendored
54
.github/workflows/build-ci.yml
vendored
@@ -16,12 +16,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.gh.outputs.version }}
|
||||
release: ${{ steps.gh.outputs.release }}
|
||||
sha: ${{ steps.gh.outputs.sha }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: 'openwrt'
|
||||
|
||||
- name: GH
|
||||
id: gh
|
||||
@@ -30,7 +29,8 @@ jobs:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
echo "version=$(cat youtubeUnblock/Makefile | grep PKG_VERSION | sed 's/PKG_VERSION:=//')" >> $GITHUB_OUTPUT
|
||||
echo "version=$(cat Makefile | grep "PKG_VERSION :=" | sed 's/PKG_VERSION := //')" >> $GITHUB_OUTPUT
|
||||
echo "release=$(cat Makefile | grep "PKG_RELEASE :=" | sed 's/PKG_RELEASE := //')" >> $GITHUB_OUTPUT
|
||||
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
|
||||
echo "sha=$(echo ${GITHUB_SHA::7})" >> $GITHUB_OUTPUT
|
||||
else
|
||||
@@ -72,6 +72,7 @@ jobs:
|
||||
ARCH: ${{ matrix.arch }}
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
@@ -85,7 +86,7 @@ jobs:
|
||||
make -j$(nproc) CC="ccache gcc -static-libgcc -static" || exit 1
|
||||
strip -s build/youtubeUnblock
|
||||
cp -va build/youtubeUnblock .
|
||||
tar -czvf youtubeUnblock-$VERSION-$SHA-$PLATFORM-static.tar.gz youtubeUnblock youtubeUnblock.service README.md
|
||||
tar -czvf youtubeUnblock-$VERSION-$RELEASE-$SHA-$PLATFORM-static.tar.gz youtubeUnblock youtubeUnblock.service README.md
|
||||
ccache --show-stats
|
||||
|
||||
- name: Upload artifacts
|
||||
@@ -114,6 +115,8 @@ jobs:
|
||||
tool: mips-unknown-linux-musl
|
||||
- arch: mipssf
|
||||
tool: mips-unknown-linux-muslsf
|
||||
- arch: armv7sf
|
||||
tool: armv7-unknown-linux-musleabi
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -135,6 +138,7 @@ jobs:
|
||||
ARCH: ${{ matrix.arch }}
|
||||
TOOL: ${{ matrix.tool }}
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
run: |
|
||||
make -j$(nproc) \
|
||||
@@ -146,13 +150,13 @@ jobs:
|
||||
CROSS_COMPILE_PLATFORM=$TOOL || exit 1
|
||||
$TOOL-strip -s build/youtubeUnblock
|
||||
cp -va build/youtubeUnblock .
|
||||
tar -czvf youtubeUnblock-$VERSION-$SHA-$ARCH-static.tar.gz youtubeUnblock youtubeUnblock.service README.md
|
||||
tar -czvf youtubeUnblock-$VERSION-$RELEASE-$SHA-$ARCH-static.tar.gz youtubeUnblock youtubeUnblock.service README.md
|
||||
|
||||
- name: Upload artifacts
|
||||
if: steps.build.outcome == 'success'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: static-${{ matrix.arch }}
|
||||
name: youtubeUnblock-static-${{ matrix.arch }}
|
||||
path: ./**/youtubeUnblock*.tar.gz
|
||||
|
||||
build-openwrt:
|
||||
@@ -201,14 +205,16 @@ jobs:
|
||||
- name: Prepare build
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
run: |
|
||||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$SHA/" youtubeUnblock/Makefile
|
||||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$RELEASE-$SHA/" youtubeUnblock/Makefile
|
||||
|
||||
- name: Build packages
|
||||
id: build
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
working-directory: /builder
|
||||
run: |
|
||||
@@ -218,7 +224,7 @@ jobs:
|
||||
./scripts/feeds install -a -p youtubeUnblock
|
||||
make defconfig
|
||||
make package/youtubeUnblock/compile V=s
|
||||
mv $(find ./bin -type f -name 'youtubeUnblock*.ipk') ./youtubeUnblock-$VERSION-$SHA-${{ matrix.arch }}-${{ matrix.branch }}.ipk
|
||||
mv $(find ./bin -type f -name 'youtubeUnblock*.ipk') ./youtubeUnblock-$VERSION-$RELEASE-$SHA-${{ matrix.arch }}-${{ matrix.branch }}.ipk
|
||||
|
||||
- name: Upload packages
|
||||
if: steps.build.outcome == 'success'
|
||||
@@ -243,14 +249,16 @@ jobs:
|
||||
- name: Prepare build
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
run: |
|
||||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$SHA/" youtubeUnblock/Makefile
|
||||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$RELEASE-$SHA/" youtubeUnblock/Makefile
|
||||
|
||||
- name: Build packages
|
||||
id: build
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
working-directory: /builder
|
||||
run: |
|
||||
@@ -260,7 +268,7 @@ jobs:
|
||||
./scripts/feeds install -a -p youtubeUnblock
|
||||
make defconfig
|
||||
make package/luci-app-youtubeUnblock/compile V=s
|
||||
mv $(find ./bin -type f -name 'luci-app-youtubeUnblock*.ipk') ./luci-app-youtubeUnblock-$VERSION-$SHA.ipk
|
||||
mv $(find ./bin -type f -name 'luci-app-youtubeUnblock*.ipk') ./luci-app-youtubeUnblock-$VERSION-$RELEASE-$SHA.ipk
|
||||
|
||||
- name: Upload packages
|
||||
if: steps.build.outcome == 'success'
|
||||
@@ -281,6 +289,11 @@ jobs:
|
||||
- mips-3.4
|
||||
- mipsel-3.4
|
||||
- x64-3.2
|
||||
include:
|
||||
- arch: armv7-2.6
|
||||
k26: true
|
||||
- arch: x86-2.6
|
||||
k26: true
|
||||
steps:
|
||||
- name: Set up Entware docker container
|
||||
run: |
|
||||
@@ -302,10 +315,19 @@ jobs:
|
||||
docker run --rm --mount source=entware-home,target=/home/me -w /home/me ubuntu bash -c 'cp -r ./backup_vol/* ./'
|
||||
docker run --rm --mount source=entware-home,target=/home/me -w /home/me ubuntu bash -c 'chown -R 1000:1000 ./* ./'
|
||||
|
||||
- name: Build Entware
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
- name: Obtain Entware
|
||||
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && ! matrix.k26 }}
|
||||
run: |
|
||||
docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me --name builder builder git clone --depth 1 https://github.com/Entware/Entware.git
|
||||
|
||||
- name: Obtain Entware k2.6
|
||||
if: ${{ steps.cache-restore.outputs.cache-hit != 'true' && matrix.k26 }}
|
||||
run: |
|
||||
docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me --name builder builder git clone --depth 1 https://github.com/Entware/Entware.git -b k2.6
|
||||
|
||||
- name: Build Entware
|
||||
if: steps.cache-restore.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me/Entware --name builder builder make package/symlinks
|
||||
docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me/Entware --name builder builder cp -v configs/${{ matrix.arch }}.config .config
|
||||
docker run --rm -i --mount source=entware-home,target=/home/me -w /home/me/Entware --name builder builder make -j$(nproc) toolchain/install
|
||||
@@ -327,9 +349,10 @@ jobs:
|
||||
- name: Prepare build
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
run: |
|
||||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$SHA/" youtubeUnblock/Makefile
|
||||
sed -i "s/PKG_REV:=.*$/PKG_REV:=$SHA/;s/PKG_VERSION:=.*$/PKG_VERSION:=$VERSION-$RELEASE-$SHA/" youtubeUnblock/Makefile
|
||||
|
||||
- name: Build packages
|
||||
id: build
|
||||
@@ -345,6 +368,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: ${{ needs.prepare.outputs.version }}
|
||||
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||
SHA: ${{ needs.prepare.outputs.sha }}
|
||||
run: |
|
||||
mkdir output
|
||||
@@ -352,7 +376,7 @@ jobs:
|
||||
rm -rf youtubeUnblock || true
|
||||
mkdir youtubeUnblock
|
||||
bash -c "cp -r ./output/* youtubeUnblock"
|
||||
tar -czvf youtubeUnblock-$VERSION-$SHA-${{ matrix.arch }}-entware.tar.gz youtubeUnblock
|
||||
tar -czvf youtubeUnblock-$VERSION-$RELEASE-$SHA-${{ matrix.arch }}-entware.tar.gz youtubeUnblock
|
||||
|
||||
- name: Upload packages
|
||||
if: steps.build.outcome == 'success'
|
||||
@@ -364,7 +388,7 @@ jobs:
|
||||
|
||||
pre-release:
|
||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
||||
needs: [build-static, build-static-cross, build-openwrt, build-entware]
|
||||
needs: [build-static, build-static-cross, build-openwrt, build-entware, build-openwrt-luci]
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
Reference in New Issue
Block a user