switch to branch next on upstream py-kms

This commit is contained in:
ElevenNotes
2025-02-10 10:39:20 +01:00
parent b48eeb675e
commit c157fc1094
7 changed files with 34 additions and 1065 deletions

View File

@@ -2,12 +2,19 @@ name: create and publish docker image
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
release:
description: 'create release or not'
required: false
default: true
type: 'boolean'
push: push:
tags: tags:
- 'v*' - 'v*'
env: env:
DOCKER_USERNAME: 11notes DOCKER_USERNAME: 11notes
RELEASE: true
jobs: jobs:
build-and-push-image: build-and-push-image:
@@ -36,19 +43,27 @@ jobs:
export LOCAL_SEMVER_MAJOR=$(awk -F. '{ print $1 }' <<< ${json_version}) export LOCAL_SEMVER_MAJOR=$(awk -F. '{ print $1 }' <<< ${json_version})
export LOCAL_SEMVER_MINOR=$(awk -F. '{ print $2 }' <<< ${json_version}) export LOCAL_SEMVER_MINOR=$(awk -F. '{ print $2 }' <<< ${json_version})
export LOCAL_SEMVER_PATCH=$(awk -F. '{ print $3 }' <<< ${json_version}) export LOCAL_SEMVER_PATCH=$(awk -F. '{ print $3 }' <<< ${json_version})
export LOCAL_TAGS="${json_image}:latest" export LOCAL_TAGS="${json_image}:${LOCAL_SHA}"
if [ ! -z ${LOCAL_SEMVER_MAJOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}"; fi if [ ! -z ${LOCAL_SEMVER_MAJOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}"; fi
if [ ! -z ${LOCAL_SEMVER_MINOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}"; fi if [ ! -z ${LOCAL_SEMVER_MINOR} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}"; fi
if [ ! -z ${LOCAL_SEMVER_PATCH} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}.${LOCAL_SEMVER_PATCH}"; fi if [ ! -z ${LOCAL_SEMVER_PATCH} ]; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SEMVER_MAJOR}.${LOCAL_SEMVER_MINOR}.${LOCAL_SEMVER_PATCH}"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_stable}" ; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:stable"; fi if echo "${LOCAL_TAGS}" | grep -q "${json_stable}" ; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:stable"; fi
if echo "${LOCAL_TAGS}" | grep -q "${json_latest}" ; then LOCAL_TAGS="${LOCAL_TAGS},${json_image}:latest"; fi
if [ ! -z ${json_tags} ]; then SPECIAL_LOCAL_TAGS=$(echo ${json_tags} | sed 's/,/ /g'); for LOCAL_TAG in ${json_tags}; do LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_TAG}"; done; fi if [ ! -z ${json_tags} ]; then SPECIAL_LOCAL_TAGS=$(echo ${json_tags} | sed 's/,/ /g'); for LOCAL_TAG in ${json_tags}; do LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_TAG}"; done; fi
LOCAL_TAGS="${LOCAL_TAGS},${json_image}:${LOCAL_SHA}"
echo "IMAGE_TAGS=${LOCAL_TAGS}" >> $GITHUB_ENV echo "IMAGE_TAGS=${LOCAL_TAGS}" >> $GITHUB_ENV
: # if for whatever reason UID/GID must be changed at build time : # if for whatever reason UID/GID must be changed at build time
echo "IMAGE_UID=${json_uid:-1000}" >> $GITHUB_ENV echo "IMAGE_UID=${json_uid:-1000}" >> $GITHUB_ENV
echo "IMAGE_GID=${json_gid:-1000}" >> $GITHUB_ENV echo "IMAGE_GID=${json_gid:-1000}" >> $GITHUB_ENV
: # echo inputs
echo "${{ toJSON(github.event.inputs) }}"
- name: github / disable release
if: ${{ inputs.release != null && inputs.release == false }}
run: |
echo "RELEASE=false" >> $GITHUB_ENV
- name: docker / login to hub - name: docker / login to hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with: with:
@@ -88,6 +103,10 @@ jobs:
image: ${{ env.json_image }}:grype image: ${{ env.json_image }}:grype
severity-cutoff: high severity-cutoff: high
- name: grype / report / print
if: success() || failure()
run: cat ${{ steps.scan.outputs.sarif }}
- name: grype / delete tag - name: grype / delete tag
if: success() || failure() if: success() || failure()
run: | run: |
@@ -102,9 +121,6 @@ jobs:
with: with:
sarif_file: ${{ steps.scan.outputs.sarif }} sarif_file: ${{ steps.scan.outputs.sarif }}
- name: grype / report / print
run: cat ${{ steps.scan.outputs.sarif }}
- name: docker / build & push - name: docker / build & push
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d
with: with:
@@ -128,9 +144,11 @@ jobs:
${{ env.IMAGE_TAGS }} ${{ env.IMAGE_TAGS }}
- name: github / create release notes - name: github / create release notes
if: ${{ env.RELEASE == 'true' && hashFiles('RELEASE.md') != '' }}
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create ${{ github.ref_name }} -F RELEASE.md run: |
gh release create ${{ github.ref_name }} -F RELEASE.md
- name: github / update description and set repo defaults - name: github / update description and set repo defaults
run: | run: |

4
.json
View File

@@ -2,9 +2,9 @@
"image":"11notes/kms", "image":"11notes/kms",
"description":"Activate any version of Windows and Office, forever", "description":"Activate any version of Windows and Office, forever",
"name":"kms", "name":"kms",
"version":"646f476", "version":"465f4d1",
"root":"/kms", "root":"/kms",
"stable":"646f476", "stable":"465f4d1",
"parent":"11notes/alpine:stable" "parent":"11notes/alpine:stable"
} }

View File

@@ -1,7 +1,7 @@
![Banner](https://github.com/11notes/defaults/blob/main/static/img/banner.png?raw=true) ![Banner](https://github.com/11notes/defaults/blob/main/static/img/banner.png?raw=true)
# 🏔️ kms on Alpine # 🏔️ kms on Alpine
[<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms)![size](https://img.shields.io/docker/image-size/11notes/kms/646f476?color=0eb305)![version](https://img.shields.io/docker/v/11notes/kms/646f476?color=eb7a09)![pulls](https://img.shields.io/docker/pulls/11notes/kms?color=2b75d6)[<img src="https://img.shields.io/github/issues/11notes/docker-kms?color=7842f5">](https://github.com/11notes/docker-kms/issues) [<img src="https://img.shields.io/badge/github-source-blue?logo=github&color=040308">](https://github.com/11notes/docker-kms)![size](https://img.shields.io/docker/image-size/11notes/kms/465f4d1?color=0eb305)![version](https://img.shields.io/docker/v/11notes/kms/465f4d1?color=eb7a09)![pulls](https://img.shields.io/docker/pulls/11notes/kms?color=2b75d6)[<img src="https://img.shields.io/github/issues/11notes/docker-kms?color=7842f5">](https://github.com/11notes/docker-kms/issues)
**Activate any version of Windows and Office, forever** **Activate any version of Windows and Office, forever**
@@ -41,7 +41,7 @@ Works with:
name: "kms" name: "kms"
services: services:
kms: kms:
image: "11notes/kms:646f476" image: "11notes/kms:465f4d1"
container_name: "kms" container_name: "kms"
environment: environment:
TZ: "Europe/Zurich" TZ: "Europe/Zurich"

View File

@@ -1,2 +1,2 @@
### 🪄 Features ### 🚀 Updates
* drop KMS_ENHANCED_PRIVACY_ID * switch to branch next on upstream py-kms

View File

@@ -1,18 +1,11 @@
# :: Util # :: Util
FROM alpine/git AS util FROM 11notes/util AS util
ARG NO_CACHE
RUN set -ex; \
git clone https://github.com/11notes/docker-util.git;
# :: Build / py-kms # :: Build / py-kms
FROM alpine/git AS build FROM alpine/git AS build
ARG APP_VERSION ARG APP_VERSION
RUN set -ex; \ RUN set -ex; \
git clone https://github.com/Py-KMS-Organization/py-kms.git; \ git clone https://github.com/Py-KMS-Organization/py-kms.git -b next; \
cd /git/py-kms; \ cd /git/py-kms; \
git checkout ${APP_VERSION}; \ git checkout ${APP_VERSION}; \
cp -R /git/py-kms/docker/docker-py3-kms-minimal/requirements.txt /git/py-kms/py-kms/requirements.txt; \ cp -R /git/py-kms/docker/docker-py3-kms-minimal/requirements.txt /git/py-kms/py-kms/requirements.txt; \
@@ -43,7 +36,7 @@
ENV KMS_LOGLEVEL="INFO" ENV KMS_LOGLEVEL="INFO"
# :: multi-stage # :: multi-stage
COPY --from=util /git/docker-util/src/ /usr/local/bin COPY --from=util /usr/local/bin/ /usr/local/bin
COPY --from=build /git/py-kms/py-kms/ /opt/py-kms COPY --from=build /git/py-kms/py-kms/ /opt/py-kms
# :: Run # :: Run

View File

@@ -1,7 +1,7 @@
name: "kms" name: "kms"
services: services:
kms: kms:
image: "11notes/kms:646f476" image: "11notes/kms:465f4d1"
container_name: "kms" container_name: "kms"
environment: environment:
TZ: "Europe/Zurich" TZ: "Europe/Zurich"

File diff suppressed because it is too large Load Diff