mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-07 13:13:34 +00:00
Merge branch 'main' of github.com:GAM-team/GAM
This commit is contained in:
3
.github/actions/decrypt.sh
vendored
3
.github/actions/decrypt.sh
vendored
@ -14,4 +14,5 @@ gpg --quiet --batch --yes --decrypt --passphrase="${PASSCODE}" \
|
|||||||
--output "${credsfile}" "${gpgfile}"
|
--output "${credsfile}" "${gpgfile}"
|
||||||
|
|
||||||
tar xvvf "${credsfile}" --directory "${gampath}"
|
tar xvvf "${credsfile}" --directory "${gampath}"
|
||||||
ls -l "${gampath}"
|
rm -rvf "${gpgfile}"
|
||||||
|
rm -rvf "${credsfile}"
|
||||||
|
57
.github/workflows/build.yml
vendored
57
.github/workflows/build.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
|||||||
goal: build
|
goal: build
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
openssl_archs: linux-x86_64
|
openssl_archs: linux-x86_64
|
||||||
- os: [self-hosted, linux, arm64]
|
- os: [self-hosted, linux, arm64, gcp]
|
||||||
jid: 2
|
jid: 2
|
||||||
goal: build
|
goal: build
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
@ -66,7 +66,7 @@ jobs:
|
|||||||
arch: x86_64
|
arch: x86_64
|
||||||
- os: ubuntu-22.04
|
- os: ubuntu-22.04
|
||||||
goal: test
|
goal: test
|
||||||
python: "3.11-dev"
|
python: "3.10"
|
||||||
jid: 10
|
jid: 10
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
|
|
||||||
@ -84,7 +84,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
bin.tar.xz
|
bin.tar.xz
|
||||||
key: gam-${{ matrix.jid }}-20221006
|
src/cpython
|
||||||
|
key: gam-${{ matrix.jid }}-20221101
|
||||||
|
|
||||||
- name: Untar Cache archive
|
- name: Untar Cache archive
|
||||||
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true'
|
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true'
|
||||||
@ -155,6 +156,7 @@ jobs:
|
|||||||
openssl_archs: ${{ matrix.openssl_archs }}
|
openssl_archs: ${{ matrix.openssl_archs }}
|
||||||
run: |
|
run: |
|
||||||
echo "We are running on ${RUNNER_OS}"
|
echo "We are running on ${RUNNER_OS}"
|
||||||
|
LD_LIBRARY_PATH="${OPENSSL_INSTALL_PATH}/lib:${PYTHON_INSTALL_PATH}/lib"
|
||||||
if [[ "${arch}" == "Win64" ]]; then
|
if [[ "${arch}" == "Win64" ]]; then
|
||||||
PYEXTERNALS_PATH="amd64"
|
PYEXTERNALS_PATH="amd64"
|
||||||
PYBUILDRELEASE_ARCH="x64"
|
PYBUILDRELEASE_ARCH="x64"
|
||||||
@ -186,21 +188,21 @@ jobs:
|
|||||||
MAKE=nmake
|
MAKE=nmake
|
||||||
MAKEOPT=""
|
MAKEOPT=""
|
||||||
PERL="c:\strawberry\perl\bin\perl.exe"
|
PERL="c:\strawberry\perl\bin\perl.exe"
|
||||||
echo "PYTHON=${PYTHON_INSTALL_PATH}\python.exe" >> $GITHUB_ENV
|
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${PYTHON_SOURCE_PATH}/PCbuild/${PYEXTERNALS_PATH}"
|
||||||
|
echo "PYTHON=${PYTHON_SOURCE_PATH}/PCbuild/${PYEXTERNALS_PATH}/python.exe" >> $GITHUB_ENV
|
||||||
echo "GAM_ARCHIVE_ARCH=${GAM_ARCHIVE_ARCH}" >> $GITHUB_ENV
|
echo "GAM_ARCHIVE_ARCH=${GAM_ARCHIVE_ARCH}" >> $GITHUB_ENV
|
||||||
echo "WIX_ARCH=${WIX_ARCH}" >> $GITHUB_ENV
|
echo "WIX_ARCH=${WIX_ARCH}" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
echo "We'll run make with: ${MAKEOPT}"
|
echo "We'll run make with: ${MAKEOPT}"
|
||||||
echo "JID=${jid}" >> $GITHUB_ENV
|
echo "JID=${jid}" >> $GITHUB_ENV
|
||||||
echo "arch=${arch}" >> $GITHUB_ENV
|
echo "arch=${arch}" >> $GITHUB_ENV
|
||||||
|
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
|
||||||
echo "MAKE=${MAKE}" >> $GITHUB_ENV
|
echo "MAKE=${MAKE}" >> $GITHUB_ENV
|
||||||
echo "MAKEOPT=${MAKEOPT}" >> $GITHUB_ENV
|
echo "MAKEOPT=${MAKEOPT}" >> $GITHUB_ENV
|
||||||
echo "PERL=${PERL}" >> $GITHUB_ENV
|
echo "PERL=${PERL}" >> $GITHUB_ENV
|
||||||
echo "PYEXTERNALS_PATH=${PYEXTERNALS_PATH}" >> $GITHUB_ENV
|
echo "PYEXTERNALS_PATH=${PYEXTERNALS_PATH}" >> $GITHUB_ENV
|
||||||
echo "PYBUILDRELEASE_ARCH=${PYBUILDRELEASE_ARCH}" >> $GITHUB_ENV
|
echo "PYBUILDRELEASE_ARCH=${PYBUILDRELEASE_ARCH}" >> $GITHUB_ENV
|
||||||
echo "openssl_archs=${openssl_archs}" >> $GITHUB_ENV
|
echo "openssl_archs=${openssl_archs}" >> $GITHUB_ENV
|
||||||
echo "LD_LIBRARY_PATH=${OPENSSL_INSTALL_PATH}/lib:${PYTHON_INSTALL_PATH}/lib" >> $GITHUB_ENV
|
|
||||||
#echo "PATH=${PATH}:${PYTHON_INSTALL_PATH}/scripts" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Get latest stable OpenSSL source
|
- name: Get latest stable OpenSSL source
|
||||||
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
||||||
@ -338,7 +340,7 @@ jobs:
|
|||||||
$env:OPENSSL_EXT_TARGET_PATH = "${env:OPENSSL_EXT_PATH}${env:PYEXTERNALS_PATH}"
|
$env:OPENSSL_EXT_TARGET_PATH = "${env:OPENSSL_EXT_PATH}${env:PYEXTERNALS_PATH}"
|
||||||
echo "Copying our OpenSSL to ${env:OPENSSL_EXT_TARGET_PATH}"
|
echo "Copying our OpenSSL to ${env:OPENSSL_EXT_TARGET_PATH}"
|
||||||
mkdir "${env:OPENSSL_EXT_TARGET_PATH}\include\openssl\"
|
mkdir "${env:OPENSSL_EXT_TARGET_PATH}\include\openssl\"
|
||||||
Copy-Item -Path "${env:GITHUB_WORKSPACE}/src/openssl-${env:openssl_archs}\LICENSE.txt" -Destination "${env:OPENSSL_EXT_TARGET_PATH}\LICENSE"
|
Copy-Item -Path "${env:GITHUB_WORKSPACE}/src/openssl-${env:openssl_archs}\LICENSE.txt" -Destination "${env:OPENSSL_EXT_TARGET_PATH}\LICENSE" -Verbose
|
||||||
cp -v "$env:OPENSSL_INSTALL_PATH\lib\*" "${env:OPENSSL_EXT_TARGET_PATH}"
|
cp -v "$env:OPENSSL_INSTALL_PATH\lib\*" "${env:OPENSSL_EXT_TARGET_PATH}"
|
||||||
cp -v "$env:OPENSSL_INSTALL_PATH\bin\*" "${env:OPENSSL_EXT_TARGET_PATH}"
|
cp -v "$env:OPENSSL_INSTALL_PATH\bin\*" "${env:OPENSSL_EXT_TARGET_PATH}"
|
||||||
cp -v "$env:OPENSSL_INSTALL_PATH\include\openssl\*" "${env:OPENSSL_EXT_TARGET_PATH}\include\openssl\"
|
cp -v "$env:OPENSSL_INSTALL_PATH\include\openssl\*" "${env:OPENSSL_EXT_TARGET_PATH}\include\openssl\"
|
||||||
@ -358,22 +360,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd "${env:PYTHON_SOURCE_PATH}"
|
cd "${env:PYTHON_SOURCE_PATH}"
|
||||||
# We need out custom openssl.props which uses OpenSSL 3 DLL names
|
# We need out custom openssl.props which uses OpenSSL 3 DLL names
|
||||||
Copy-Item -Path "${env:GITHUB_WORKSPACE}\src\tools\openssl.props" -Destination PCBuild\
|
Copy-Item -Path "${env:GITHUB_WORKSPACE}\src\tools\openssl.props" -Destination PCBuild\ -Verbose
|
||||||
echo "Building for ${env:PYBUILDRELEASE_ARCH}..."
|
echo "Building for ${env:PYBUILDRELEASE_ARCH}..."
|
||||||
PCBuild\build.bat -m --pgo -c Release -p "${env:PYBUILDRELEASE_ARCH}"
|
PCBuild\build.bat -m --pgo -c Release -p "${env:PYBUILDRELEASE_ARCH}"
|
||||||
|
|
||||||
- name: Windows Install Python
|
|
||||||
if: matrix.goal == 'build' && runner.os == 'Windows' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
cd "${env:PYTHON_SOURCE_PATH}"
|
|
||||||
mkdir "${env:PYTHON_INSTALL_PATH}\lib"
|
|
||||||
mkdir "${env:PYTHON_INSTALL_PATH}\include"
|
|
||||||
Copy-Item -Path "PCBuild\${env:PYEXTERNALS_PATH}\*" "${env:PYTHON_INSTALL_PATH}\"
|
|
||||||
Copy-Item -Path "${env:PYTHON_SOURCE_PATH}\Lib\*" "${env:PYTHON_INSTALL_PATH}\lib\" -recurse
|
|
||||||
Copy-Item -Path "${env:PYTHON_SOURCE_PATH}\Include\*" "${env:PYTHON_INSTALL_PATH}\include\" -recurse
|
|
||||||
Copy-Item -Path "${env:PYTHON_SOURCE_PATH}\PC\*.h" "${env:PYTHON_INSTALL_PATH}\include\"
|
|
||||||
|
|
||||||
- name: Mac/Linux Build Python
|
- name: Mac/Linux Build Python
|
||||||
if: matrix.goal == 'build' && runner.os != 'Windows' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
if: matrix.goal == 'build' && runner.os != 'Windows' && steps.cache-python-ssl.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
@ -387,6 +377,9 @@ jobs:
|
|||||||
cd "${PYTHON_SOURCE_PATH}"
|
cd "${PYTHON_SOURCE_PATH}"
|
||||||
$MAKE altinstall
|
$MAKE altinstall
|
||||||
$MAKE bininstall
|
$MAKE bininstall
|
||||||
|
export PATH="${PATH}:${PYTHON_INSTALL_PATH}/bin"
|
||||||
|
echo "PATH=${PATH}" >> $GITHUB_ENV
|
||||||
|
echo "PATH: ${PATH}"
|
||||||
|
|
||||||
- name: Run Python
|
- name: Run Python
|
||||||
run: |
|
run: |
|
||||||
@ -403,17 +396,14 @@ jobs:
|
|||||||
- name: Install pip requirements
|
- name: Install pip requirements
|
||||||
run: |
|
run: |
|
||||||
if [[ "${RUNNER_OS}" == "macOS" ]]; then
|
if [[ "${RUNNER_OS}" == "macOS" ]]; then
|
||||||
for package in cryptography; do
|
|
||||||
"${PYTHON}" -m pip install --upgrade cffi ${PIP_ARGS}
|
"${PYTHON}" -m pip install --upgrade cffi ${PIP_ARGS}
|
||||||
"${PYTHON}" -m pip download --only-binary :all: \
|
"${PYTHON}" -m pip download --only-binary :all: \
|
||||||
--dest . \
|
--dest . \
|
||||||
--no-cache \
|
--no-cache \
|
||||||
--no-deps \
|
--no-deps \
|
||||||
--platform macosx_10_15_universal2 \
|
--platform macosx_10_15_universal2 \
|
||||||
$package
|
cryptography
|
||||||
"${PYTHON}" -m pip install --force-reinstall --no-deps $package*.whl
|
"${PYTHON}" -m pip install --force-reinstall --no-deps cryptography*.whl
|
||||||
done
|
|
||||||
find $PYTHON_INSTALL_PATH/lib/python3.10/site-packages -type f -name "*.so" -exec du -sh "{}" \;
|
|
||||||
fi
|
fi
|
||||||
"${PYTHON}" -m pip install --upgrade -r requirements.txt ${PIP_ARGS}
|
"${PYTHON}" -m pip install --upgrade -r requirements.txt ${PIP_ARGS}
|
||||||
"${PYTHON}" -m pip list
|
"${PYTHON}" -m pip list
|
||||||
@ -424,8 +414,6 @@ jobs:
|
|||||||
git clone https://github.com/pyinstaller/pyinstaller.git
|
git clone https://github.com/pyinstaller/pyinstaller.git
|
||||||
cd pyinstaller
|
cd pyinstaller
|
||||||
export latest_release=$(git tag --list | grep -v dev | grep -v rc | sort -Vr | head -n1)
|
export latest_release=$(git tag --list | grep -v dev | grep -v rc | sort -Vr | head -n1)
|
||||||
# temp freeze PyInstaller at 5.3
|
|
||||||
export latest_release="v5.3"
|
|
||||||
git checkout "${latest_release}"
|
git checkout "${latest_release}"
|
||||||
# remove pre-compiled bootloaders so we fail if bootloader compile fails
|
# remove pre-compiled bootloaders so we fail if bootloader compile fails
|
||||||
rm -rvf PyInstaller/bootloader/*-*/*
|
rm -rvf PyInstaller/bootloader/*-*/*
|
||||||
@ -446,6 +434,10 @@ jobs:
|
|||||||
mkdir -p -v "${gampath}"
|
mkdir -p -v "${gampath}"
|
||||||
if [[ "${RUNNER_OS}" == "macOS" ]]; then
|
if [[ "${RUNNER_OS}" == "macOS" ]]; then
|
||||||
export gampath=$($PYTHON -c "import os; print(os.path.realpath('$gampath'))")
|
export gampath=$($PYTHON -c "import os; print(os.path.realpath('$gampath'))")
|
||||||
|
elif [[ "${RUNNER_OS}" == "Windows" ]]; then
|
||||||
|
# Work around issue where PyInstaller picks up python3.dll from other Python versions
|
||||||
|
# https://github.com/pyinstaller/pyinstaller/issues/7102
|
||||||
|
export PATH="/usr/bin"
|
||||||
else
|
else
|
||||||
export gampath=$(realpath "${gampath}")
|
export gampath=$(realpath "${gampath}")
|
||||||
fi
|
fi
|
||||||
@ -699,17 +691,6 @@ jobs:
|
|||||||
#echo "using delegated admin service account"
|
#echo "using delegated admin service account"
|
||||||
#$gam print users
|
#$gam print users
|
||||||
|
|
||||||
# - name: Upload to Google Drive, build only.
|
|
||||||
# if: github.event_name == 'push' && matrix.goal != 'test'
|
|
||||||
# run: |
|
|
||||||
# ls gam-$GAMVERSION-*
|
|
||||||
# for gamfile in gam-$GAMVERSION-*; do
|
|
||||||
# echo "Uploading file ${gamfile} to Google Drive..."
|
|
||||||
# fileid=$($gam user $gam_user add drivefile localfile $gamfile drivefilename $GAMVERSION-${GITHUB_SHA:0:7}-$gamfile parentid 1N2zbO33qzUQFsGM49-m9AQC1ijzd_ru1 returnidonly)
|
|
||||||
# echo "file uploaded as ${fileid}, setting ACL..."
|
|
||||||
# $gam user $gam_user add drivefileacl $fileid anyone role reader withlink
|
|
||||||
# done
|
|
||||||
|
|
||||||
- name: Archive production artifacts
|
- name: Archive production artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
if: (github.event_name == 'push' || github.event_name == 'schedule') && matrix.goal != 'test'
|
if: (github.event_name == 'push' || github.event_name == 'schedule') && matrix.goal != 'test'
|
||||||
|
@ -634,18 +634,19 @@ TIME_OFFSET_UNITS = [('day', 86400), ('hour', 3600), ('minute', 60),
|
|||||||
|
|
||||||
|
|
||||||
def getLocalGoogleTimeOffset(testLocation='admin.googleapis.com'):
|
def getLocalGoogleTimeOffset(testLocation='admin.googleapis.com'):
|
||||||
|
# Try with http first, if time is close (<MAX_LOCAL_GOOGLE_TIME_OFFSET seconds),
|
||||||
|
# retry with https
|
||||||
|
badhttp = transport.create_http()
|
||||||
|
for prot in ['http', 'https']:
|
||||||
localUTC = datetime.datetime.now(datetime.timezone.utc)
|
localUTC = datetime.datetime.now(datetime.timezone.utc)
|
||||||
try:
|
try:
|
||||||
# we disable SSL verify so we can still get time even if clock
|
|
||||||
# is way off. This could be spoofed / MitM but we'll fail for those
|
|
||||||
# situations everywhere else but here.
|
|
||||||
badhttp = transport.create_http()
|
|
||||||
badhttp.disable_ssl_certificate_validation = True
|
|
||||||
googleUTC = dateutil.parser.parse(
|
googleUTC = dateutil.parser.parse(
|
||||||
badhttp.request('https://' + testLocation, 'HEAD')[0]['date'])
|
badhttp.request(f'{prot}://' + testLocation, 'HEAD')[0]['date'])
|
||||||
except (httplib2.ServerNotFoundError, RuntimeError, ValueError) as e:
|
except (httplib2.ServerNotFoundError, RuntimeError, ValueError) as e:
|
||||||
controlflow.system_error_exit(4, str(e))
|
controlflow.system_error_exit(4, str(e))
|
||||||
offset = remainder = int(abs((localUTC - googleUTC).total_seconds()))
|
offset = remainder = int(abs((localUTC - googleUTC).total_seconds()))
|
||||||
|
if offset < MAX_LOCAL_GOOGLE_TIME_OFFSET and prot == 'http':
|
||||||
|
continue
|
||||||
timeoff = []
|
timeoff = []
|
||||||
for tou in TIME_OFFSET_UNITS:
|
for tou in TIME_OFFSET_UNITS:
|
||||||
uval, remainder = divmod(remainder, tou[1])
|
uval, remainder = divmod(remainder, tou[1])
|
||||||
@ -11244,7 +11245,7 @@ def run_batch(items):
|
|||||||
)
|
)
|
||||||
pool.close()
|
pool.close()
|
||||||
pool.join()
|
pool.join()
|
||||||
pool = mp_pool(num_worker_threads, init_gam_worker, maxtasksperchild=200, initargs=(1,))
|
pool = mp_pool(num_worker_threads, init_gam_worker, maxtasksperchild=200, initargs=(l,))
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
'commit-batch - running processes finished, proceeding\n')
|
'commit-batch - running processes finished, proceeding\n')
|
||||||
continue
|
continue
|
||||||
|
@ -8,7 +8,7 @@ import platform
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
GAM_AUTHOR = 'Jay Lee <jay0lee@gmail.com>'
|
GAM_AUTHOR = 'Jay Lee <jay0lee@gmail.com>'
|
||||||
GAM_VERSION = '6.25'
|
GAM_VERSION = '6.30'
|
||||||
GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
GAM_LICENSE = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
GAM_URL = 'https://jaylee.us/gam'
|
GAM_URL = 'https://jaylee.us/gam'
|
||||||
@ -648,6 +648,7 @@ MACOS_CODENAMES = {
|
|||||||
},
|
},
|
||||||
11: 'Big Sur',
|
11: 'Big Sur',
|
||||||
12: 'Monterey',
|
12: 'Monterey',
|
||||||
|
13: 'Ventura',
|
||||||
}
|
}
|
||||||
|
|
||||||
_MICROSOFT_FORMATS_LIST = [{
|
_MICROSOFT_FORMATS_LIST = [{
|
||||||
|
Reference in New Issue
Block a user