diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c732a5..aea8ee5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,13 +11,21 @@ jobs: steps: - uses: actions/checkout@v4.2.1 with: - fetch-depth: '0' + fetch-depth: 0 + + - name: Extract version + id: version + run: | + VERSION=$(git describe --tags --exact-match 2>/dev/null || echo "dev_$(date +%d%m%Y)") + echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v6.9.0 with: context: . tags: podkop:ci + build-args: | + PKG_VERSION=${{ steps.version.outputs.version }} - name: Create Docker container run: docker create --name podkop podkop:ci diff --git a/Dockerfile b/Dockerfile index f589acb..cb92d74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM itdoginfo/openwrt-sdk:24.10.1 +ARG PKG_VERSION +ENV PKG_VERSION=${PKG_VERSION} + COPY ./podkop /builder/package/feeds/utilites/podkop COPY ./luci-app-podkop /builder/package/feeds/luci/luci-app-podkop diff --git a/luci-app-podkop/Makefile b/luci-app-podkop/Makefile index a745c2a..03bf9af 100644 --- a/luci-app-podkop/Makefile +++ b/luci-app-podkop/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-podkop -PKG_VERSION := $(shell git describe --tags --exact-match 2>/dev/null || echo "dev_$(shell date +%d%m%Y)") +PKG_VERSION := $(if $(PKG_VERSION),$(PKG_VERSION),dev_$(shell date +%d%m%Y)) PKG_RELEASE:=1 diff --git a/podkop/Makefile b/podkop/Makefile index dfd0df1..e86de4d 100644 --- a/podkop/Makefile +++ b/podkop/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=podkop -PKG_VERSION := $(shell git describe --tags --exact-match 2>/dev/null || echo "dev_$(shell date +%d%m%Y)") +PKG_VERSION := $(if $(PKG_VERSION),$(PKG_VERSION),dev_$(shell date +%d%m%Y)) PKG_RELEASE:=1