mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-21 22:05:56 +00:00
Add versioning
This commit is contained in:
parent
0ee6d667e4
commit
c9537bae95
34
.github/workflows/build-ci.yml
vendored
34
.github/workflows/build-ci.yml
vendored
@ -16,12 +16,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.gh.outputs.version }}
|
version: ${{ steps.gh.outputs.version }}
|
||||||
|
release: ${{ steps.gh.outputs.release }}
|
||||||
sha: ${{ steps.gh.outputs.sha }}
|
sha: ${{ steps.gh.outputs.sha }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
ref: 'openwrt'
|
|
||||||
|
|
||||||
- name: GH
|
- name: GH
|
||||||
id: gh
|
id: gh
|
||||||
@ -30,7 +29,8 @@ jobs:
|
|||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
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
|
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
|
||||||
echo "sha=$(echo ${GITHUB_SHA::7})" >> $GITHUB_OUTPUT
|
echo "sha=$(echo ${GITHUB_SHA::7})" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
@ -72,6 +72,7 @@ jobs:
|
|||||||
ARCH: ${{ matrix.arch }}
|
ARCH: ${{ matrix.arch }}
|
||||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
shell: alpine.sh {0}
|
shell: alpine.sh {0}
|
||||||
run: |
|
run: |
|
||||||
@ -85,7 +86,7 @@ jobs:
|
|||||||
make -j$(nproc) CC="ccache gcc -static-libgcc -static" || exit 1
|
make -j$(nproc) CC="ccache gcc -static-libgcc -static" || exit 1
|
||||||
strip -s build/youtubeUnblock
|
strip -s build/youtubeUnblock
|
||||||
cp -va 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
|
ccache --show-stats
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
@ -137,6 +138,7 @@ jobs:
|
|||||||
ARCH: ${{ matrix.arch }}
|
ARCH: ${{ matrix.arch }}
|
||||||
TOOL: ${{ matrix.tool }}
|
TOOL: ${{ matrix.tool }}
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
run: |
|
run: |
|
||||||
make -j$(nproc) \
|
make -j$(nproc) \
|
||||||
@ -148,13 +150,13 @@ jobs:
|
|||||||
CROSS_COMPILE_PLATFORM=$TOOL || exit 1
|
CROSS_COMPILE_PLATFORM=$TOOL || exit 1
|
||||||
$TOOL-strip -s build/youtubeUnblock
|
$TOOL-strip -s build/youtubeUnblock
|
||||||
cp -va 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
|
- name: Upload artifacts
|
||||||
if: steps.build.outcome == 'success'
|
if: steps.build.outcome == 'success'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: static-${{ matrix.arch }}
|
name: youtubeUnblock-static-${{ matrix.arch }}
|
||||||
path: ./**/youtubeUnblock*.tar.gz
|
path: ./**/youtubeUnblock*.tar.gz
|
||||||
|
|
||||||
build-openwrt:
|
build-openwrt:
|
||||||
@ -203,14 +205,16 @@ jobs:
|
|||||||
- name: Prepare build
|
- name: Prepare build
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
run: |
|
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
|
- name: Build packages
|
||||||
id: build
|
id: build
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
working-directory: /builder
|
working-directory: /builder
|
||||||
run: |
|
run: |
|
||||||
@ -220,7 +224,7 @@ jobs:
|
|||||||
./scripts/feeds install -a -p youtubeUnblock
|
./scripts/feeds install -a -p youtubeUnblock
|
||||||
make defconfig
|
make defconfig
|
||||||
make package/youtubeUnblock/compile V=s
|
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
|
- name: Upload packages
|
||||||
if: steps.build.outcome == 'success'
|
if: steps.build.outcome == 'success'
|
||||||
@ -245,14 +249,16 @@ jobs:
|
|||||||
- name: Prepare build
|
- name: Prepare build
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
run: |
|
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
|
- name: Build packages
|
||||||
id: build
|
id: build
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
working-directory: /builder
|
working-directory: /builder
|
||||||
run: |
|
run: |
|
||||||
@ -262,7 +268,7 @@ jobs:
|
|||||||
./scripts/feeds install -a -p youtubeUnblock
|
./scripts/feeds install -a -p youtubeUnblock
|
||||||
make defconfig
|
make defconfig
|
||||||
make package/luci-app-youtubeUnblock/compile V=s
|
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
|
- name: Upload packages
|
||||||
if: steps.build.outcome == 'success'
|
if: steps.build.outcome == 'success'
|
||||||
@ -343,9 +349,10 @@ jobs:
|
|||||||
- name: Prepare build
|
- name: Prepare build
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
run: |
|
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
|
- name: Build packages
|
||||||
id: build
|
id: build
|
||||||
@ -361,6 +368,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.prepare.outputs.version }}
|
VERSION: ${{ needs.prepare.outputs.version }}
|
||||||
|
RELEASE: ${{ needs.prepare.outputs.release }}
|
||||||
SHA: ${{ needs.prepare.outputs.sha }}
|
SHA: ${{ needs.prepare.outputs.sha }}
|
||||||
run: |
|
run: |
|
||||||
mkdir output
|
mkdir output
|
||||||
@ -368,7 +376,7 @@ jobs:
|
|||||||
rm -rf youtubeUnblock || true
|
rm -rf youtubeUnblock || true
|
||||||
mkdir youtubeUnblock
|
mkdir youtubeUnblock
|
||||||
bash -c "cp -r ./output/* 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
|
- name: Upload packages
|
||||||
if: steps.build.outcome == 'success'
|
if: steps.build.outcome == 'success'
|
||||||
@ -380,7 +388,7 @@ jobs:
|
|||||||
|
|
||||||
pre-release:
|
pre-release:
|
||||||
if: github.event_name != 'pull_request' && github.ref_name == 'main'
|
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:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
7
Makefile
7
Makefile
@ -1,6 +1,13 @@
|
|||||||
USPACE_TARGETS := default all install uninstall dev run_dev
|
USPACE_TARGETS := default all install uninstall dev run_dev
|
||||||
KMAKE_TARGETS := kmake kload kunload kreload xmod xtclean
|
KMAKE_TARGETS := kmake kload kunload kreload xmod xtclean
|
||||||
|
|
||||||
|
PKG_VERSION := 1.0.0
|
||||||
|
PKG_RELEASE := 4
|
||||||
|
|
||||||
|
PKG_FULLVERSION := $(PKG_VERSION)-$(PKG_RELEASE)
|
||||||
|
|
||||||
|
export PKG_VERSION PKG_RELEASE PKG_FULLVERSION
|
||||||
|
|
||||||
.PHONY: $(USPACE_TARGETS) $(KMAKE_TARGETS) clean
|
.PHONY: $(USPACE_TARGETS) $(KMAKE_TARGETS) clean
|
||||||
$(USPACE_TARGETS):
|
$(USPACE_TARGETS):
|
||||||
@$(MAKE) -f uspace.mk $@
|
@$(MAKE) -f uspace.mk $@
|
||||||
|
9
args.c
9
args.c
@ -110,8 +110,13 @@ static long parse_numeric_option(const char* value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void print_version() {
|
void print_version() {
|
||||||
printf("youtubeUnblock\n");
|
printf("youtubeUnblock"
|
||||||
printf("Bypasses deep packet inspection systems that relies on SNI\n");
|
#if defined(PKG_VERSION)
|
||||||
|
" " PKG_VERSION
|
||||||
|
#endif
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
|
printf("Bypasses deep packet inspection systems that rely on SNI\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
kmake.mk
2
kmake.mk
@ -13,7 +13,7 @@ KERNEL_BUILDER_MAKEDIR:=/lib/modules/$(shell uname -r)/build
|
|||||||
kmake: kmod
|
kmake: kmod
|
||||||
|
|
||||||
kmod:
|
kmod:
|
||||||
$(MAKE) -C $(KERNEL_BUILDER_MAKEDIR) M=$(PWD) modules
|
$(MAKE) -C $(KERNEL_BUILDER_MAKEDIR) M=$(PWD) EXTRA_CFLAGS='-DPKG_VERSION=\"$(PKG_FULLVERSION)\"' modules
|
||||||
|
|
||||||
kload:
|
kload:
|
||||||
insmod kyoutubeUnblock.ko
|
insmod kyoutubeUnblock.ko
|
||||||
|
@ -21,8 +21,11 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
|
|
||||||
|
#if defined(PKG_VERSION)
|
||||||
|
MODULE_VERSION(PKG_VERSION);
|
||||||
|
#endif
|
||||||
|
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
MODULE_VERSION("0.3.2");
|
|
||||||
MODULE_AUTHOR("Vadim Vetrov <vetrovvd@gmail.com>");
|
MODULE_AUTHOR("Vadim Vetrov <vetrovvd@gmail.com>");
|
||||||
MODULE_DESCRIPTION("Linux kernel module for youtubeUnblock");
|
MODULE_DESCRIPTION("Linux kernel module for youtubeUnblock");
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ else
|
|||||||
override CFLAGS += -Wall -Wpedantic -Wno-unused-variable -std=gnu11
|
override CFLAGS += -Wall -Wpedantic -Wno-unused-variable -std=gnu11
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
override CFLAGS += -DPKG_VERSION=\"$(PKG_FULLVERSION)\"
|
||||||
|
|
||||||
LIBNFNETLINK_CFLAGS := -I$(DEPSDIR)/include
|
LIBNFNETLINK_CFLAGS := -I$(DEPSDIR)/include
|
||||||
LIBNFNETLINK_LIBS := -L$(DEPSDIR)/lib
|
LIBNFNETLINK_LIBS := -L$(DEPSDIR)/lib
|
||||||
LIBMNL_CFLAGS := -I$(DEPSDIR)/include
|
LIBMNL_CFLAGS := -I$(DEPSDIR)/include
|
||||||
|
Loading…
Reference in New Issue
Block a user