diff --git a/cmd/agent_local/package/linux/nfpm.yaml b/cmd/agent_local/package/linux/nfpm.yaml index bd6e09d0..02692e25 100644 --- a/cmd/agent_local/package/linux/nfpm.yaml +++ b/cmd/agent_local/package/linux/nfpm.yaml @@ -2,7 +2,7 @@ name: "authentik-agent" arch: "${ARCH}" platform: "linux" -version: "${VERSION}+ak-${VERSION_HASH_SHORT}" +version: "${VERSION_PKG}" description: | authentik Agent vendor: "Authentik Security Inc." diff --git a/cmd/agent_system/Makefile b/cmd/agent_system/Makefile index dd48c2c8..ea37cbf7 100644 --- a/cmd/agent_system/Makefile +++ b/cmd/agent_system/Makefile @@ -37,5 +37,5 @@ package-gnu/linux: build $(call nfpm_package,${TOP}/cmd/${TARGET}/package/linux/nfpm.yaml) test-deploy: package-gnu/linux - $(TME) dpkg -i /workspaces/bin/${TARGET}/authentik-sysd_${VERSION}+ak-${VERSION_HASH_SHORT}_${ARCH}.deb + $(TME) dpkg -i /workspaces/bin/${TARGET}/authentik-sysd_${VERSION}+_${ARCH}.deb $(TME) systemctl restart ak-sysd diff --git a/cmd/agent_system/package/linux/nfpm.yaml b/cmd/agent_system/package/linux/nfpm.yaml index 38c6cc01..f2b2afd0 100644 --- a/cmd/agent_system/package/linux/nfpm.yaml +++ b/cmd/agent_system/package/linux/nfpm.yaml @@ -2,7 +2,7 @@ name: "authentik-sysd" arch: "${ARCH}" platform: "linux" -version: "${VERSION}+ak-${VERSION_HASH_SHORT}" +version: "${VERSION_PKG}" description: | authentik System Agent vendor: "Authentik Security Inc." diff --git a/cmd/cli/Makefile b/cmd/cli/Makefile index 7466253a..b46e12c0 100644 --- a/cmd/cli/Makefile +++ b/cmd/cli/Makefile @@ -32,6 +32,6 @@ package-gnu/linux: build $(call nfpm_package,${TOP}/cmd/${TARGET}/package/linux/nfpm.yaml) test-deploy: package-gnu/linux - $(TME) dpkg -i /workspaces/bin/${TARGET}/authentik-${TARGET}_${VERSION}+ak-${VERSION_HASH_SHORT}_${ARCH}.deb + $(TME) dpkg -i /workspaces/bin/${TARGET}/authentik-${TARGET}_${VERSION}+_${ARCH}.deb $(TME) systemctl restart ssh - sudo dpkg -i ${TOP}/bin/${TARGET}/authentik-${TARGET}_${VERSION}+ak-${VERSION_HASH_SHORT}_${ARCH}.deb + sudo dpkg -i ${TOP}/bin/${TARGET}/authentik-${TARGET}_${VERSION}+_${ARCH}.deb diff --git a/cmd/cli/package/linux/nfpm.yaml b/cmd/cli/package/linux/nfpm.yaml index 39f1efcb..16476a94 100644 --- a/cmd/cli/package/linux/nfpm.yaml +++ b/cmd/cli/package/linux/nfpm.yaml @@ -2,7 +2,7 @@ name: "authentik-cli" arch: "${ARCH}" platform: "linux" -version: "${VERSION}+ak-${VERSION_HASH_SHORT}" +version: "${VERSION_PKG}" description: | authentik CLI vendor: "Authentik Security Inc." diff --git a/common.mk b/common.mk index c03f135b..3e0e6d83 100644 --- a/common.mk +++ b/common.mk @@ -5,8 +5,16 @@ UID = $(shell id -u) GID = $(shell id -g) VERSION = 0.43.1 VERSION_HASH = $(shell git rev-parse HEAD) -VERSION_HASH_SHORT = $(shell git rev-parse HEAD | head -c 8) VERSION_TAG = $(shell git tag --points-at HEAD) +ifeq ($(GITHUB_ACTIONS),true) + ifeq ($(AK_IS_RELEASE),true) + VERSION_PKG = ${VERSION} + else + VERSION_PKG = ${VERSION}+ak-${shell git rev-parse HEAD | head -c 8} + endif +else + VERSION_PKG = ${VERSION} +endif VERSION_TS = $(shell date +%s) PLATFORM := $(shell bash -c "uname -o | tr '[:upper:]' '[:lower:]'") ifeq ($(OS),Windows_NT) @@ -66,13 +74,13 @@ define go_generate_resources endef define nfpm_package - VERSION=${VERSION} VERSION_HASH_SHORT=${VERSION_HASH_SHORT} ARCH=${ARCH} \ + VERSION_PKG=${VERSION_PKG} ARCH=${ARCH} \ go tool github.com/goreleaser/nfpm/v2/cmd/nfpm \ package \ -p deb \ -t ${TOP}/bin/${TARGET} \ -f $(1) - VERSION=${VERSION} VERSION_HASH_SHORT=${VERSION_HASH_SHORT} ARCH=${ARCH} \ + VERSION_PKG=${VERSION_PKG} ARCH=${ARCH} \ go tool github.com/goreleaser/nfpm/v2/cmd/nfpm \ package \ -p rpm \ diff --git a/containers/e2e/Makefile b/containers/e2e/Makefile index 00215723..65926063 100644 --- a/containers/e2e/Makefile +++ b/containers/e2e/Makefile @@ -8,7 +8,7 @@ local-build: docker build \ -t xghcr.io/goauthentik/platform-e2e:local \ --no-cache \ - --build-arg="AK_PLATFORM_VER=${VERSION}+ak-${VERSION_HASH_SHORT}" \ + --build-arg="AK_PLATFORM_VER=${VERSION_PKG}" \ --build-arg="AK_PLATFORM_ARCH=${ARCH}" \ -f "${PWD}/Dockerfile" \ ${TOP} diff --git a/containers/selenium/Makefile b/containers/selenium/Makefile index 73d06c7a..3d2226b2 100644 --- a/containers/selenium/Makefile +++ b/containers/selenium/Makefile @@ -10,7 +10,7 @@ ci-container-tag: .PHONY: ci-build-args ci-build-args: - @echo AK_PLATFORM_VER=${VERSION}+ak-${VERSION_HASH_SHORT} + @echo AK_PLATFORM_VER=${VERSION_PKG} @echo AK_DEPLOY_URL=${AK_DEPLOY_URL} .PHONY: local-build diff --git a/nss/nfpm.yaml b/nss/nfpm.yaml index 72e1a28b..dec11024 100644 --- a/nss/nfpm.yaml +++ b/nss/nfpm.yaml @@ -2,7 +2,7 @@ name: "libnss-authentik" arch: "${ARCH}" platform: "linux" -version: "${VERSION}+ak-${VERSION_HASH_SHORT}" +version: "${VERSION_PKG}" description: | NSS module for authentik vendor: "Authentik Security Inc." diff --git a/pam/nfpm.yaml b/pam/nfpm.yaml index b059c7bd..5483d81c 100644 --- a/pam/nfpm.yaml +++ b/pam/nfpm.yaml @@ -2,7 +2,7 @@ name: "libpam-authentik" arch: "${ARCH}" platform: "linux" -version: "${VERSION}+ak-${VERSION_HASH_SHORT}" +version: "${VERSION_PKG}" description: | libpam-authentik authenticates users through authentik. vendor: "Authentik Security Inc." diff --git a/vpkg/macos/Makefile b/vpkg/macos/Makefile index 19a6b5cd..d70758d7 100644 --- a/vpkg/macos/Makefile +++ b/vpkg/macos/Makefile @@ -34,7 +34,7 @@ package: pkgbuild \ --component "${TOP}/bin/${TARGET}/${MACOS_APP_NAME}" \ --identifier "io.goauthentik.agent" \ - --version "${VERSION}.${VERSION_HASH_SHORT}" \ + --version "${VERSION}" \ --scripts "${PWD}/scripts" \ --install-location /Applications \ "${TOP}/bin/${TARGET}/agent.pkg" diff --git a/vpkg/windows/Makefile b/vpkg/windows/Makefile index 6ede4f74..11b74d65 100644 --- a/vpkg/windows/Makefile +++ b/vpkg/windows/Makefile @@ -16,7 +16,7 @@ endif dotnet restore \ --packages "${TOP}/cache/${TARGET}" \ "${PWD}/" - ROOT=${TOP} VERSION=${VERSION} VERSION_HASH_SHORT=${VERSION_HASH_SHORT} dotnet build \ + ROOT=${TOP} VERSION=${VERSION} dotnet build \ --packages "${TOP}/cache/${TARGET}" \ --artifacts-path "${TOP}/cache/${TARGET}" \ --output "${TOP}/bin/${TARGET}" \ diff --git a/vpkg/windows/Package.wxs b/vpkg/windows/Package.wxs index 3293ecdc..62d8e5a8 100644 --- a/vpkg/windows/Package.wxs +++ b/vpkg/windows/Package.wxs @@ -8,7 +8,7 @@ xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">