Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/build-conquest-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# A github workflow file to build conquest python
name: Build Conquest Python

on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
deploy:
type: choice
description: 'Whether to upload conquest python build to artifactory'
options:
- 'no-upload'
- 'upload'
platforms:
description: 'Platform to build for, eg. '
options:
- 'rocky8'
- 'ubuntu22'
- 'macos'
- 'windows'
push:
files:
- '.github/workflows/build-conquest-python.yml'
- 'build_conquest_python.py'
- 'ccdc/thirdparty/package.py'

jobs:
setup:
runs-on: ubuntu-latest
outputs:
runson: ${{ steps.set_output.outputs.runson }}
container: ${{ steps.set_output.outputs.container }}
python: ${{ steps.set_output.outputs.python }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set output
id: set_output
run: |
if [[ "${{ inputs.platforms }}" == "rocky8" ]]; then
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo container=ccdcrepository.azurecr.io/conan/rocky8-gcc10:latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT
elif [[ "${{ inputs.platforms }}" == "ubuntu22" ]]; then
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT
elif [[ "${{ inputs.platforms }}" == "macos" ]]; then
echo runson=macos-12 >> $GITHUB_OUTPUT
echo python=python >> $GITHUB_OUTPUT
elif [[ "${{ inputs.platforms }}" == "windows" ]]; then
echo runson=windows-2019 >> $GITHUB_OUTPUT
echo python=python >> $GITHUB_OUTPUT
fi
# Build the conquest python for rocky8
echo runson=ubuntu-latest >> $GITHUB_OUTPUT
echo container=ccdcrepository.azurecr.io/conan/rocky8-gcc10:latest >> $GITHUB_OUTPUT
echo python=python3 >> $GITHUB_OUTPUT
build-upload:
needs:
- setup
runs-on: ${{ needs.setup.outputs.runson }}
container:
image: ${{ needs.setup.outputs.container }}
credentials:
username: ${{ secrets.AZURE_CR_USER }}
password: ${{ secrets.AZURE_CR_PASSWORD }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
if: ${{ needs.setup.outputs.python == 'python' }}
with:
python-version: '3.9'

- name: Set up Python environment
run: |
${{ needs.setup.outputs.python }} --version
${{ needs.setup.outputs.python }} -m pip install --upgrade pip wheel setuptools
- name: Build conquest python
run: |
output=$(${{ needs.setup.outputs.python }} build_conquest_python.py | grep Creating | tail -n 1)
archive_filename=$(echo $output | awk '{print $2}')
archive_path=$(echo $output | awk '{print $NF}')
echo "archive_filename=$archive_filename" >> $GITHUB_ENV
echo "archive_path=$archive_path" >> $GITHUB_ENV
- name: Set up JFrog CLI
# if: ${{ inputs.deploy == 'upload' }}
uses: jfrog/setup-jfrog-cli@v4
env:
JF_ENV_1: ${{ secrets.ARTIFACTORY_GH_CCDC_3RDPARTY_PYTHON_INTERPRETERS_READ_WRITE_EXPORT }}

- name: Upload conquest python to Artifactory
# if: ${{ inputs.deploy == 'upload' }}
shell: bash
run: |
# Upload the conquest python to Artifactory
jf c use gh-ccdc-3rdparty-python-interpreters-read-write
jfrog rt upload --flat \
"${{ env.archive_path }}/${{ env.archive_filename }}" \
"ccdc-3rdparty-python-interpreters/conquest_python/2.7/"
112 changes: 0 additions & 112 deletions azure-pipelines.yml

This file was deleted.

13 changes: 12 additions & 1 deletion build_conquest_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def install_directory(self):
class ZlibPackage(InstallInConquestPythonBaseMixin, AutoconfMixin, NoArchiveMixin, Package):
'''Zlib'''
name = 'zlib'
version = '1.2.13'
version = '1.3.1'

@property
def source_archives(self):
Expand Down Expand Up @@ -707,6 +707,17 @@ def main():
except OSError:
pass

if Package().linux:
subprocess.run('sudo dnf update -y ', shell=True, check=True)
#subprocess.run("sudo dnf install -y 'dnf-command(config-manager)'", shell=True, check=True)
#subprocess.run('sudo dnf config-manager --enable powertools', shell=True, check=True)
#subprocess.run('sudo dnf install -y epel-release', shell=True, check=True)
subprocess.run(
'sudo dnf install -y libXmu-devel',
shell=True,
check=True
)

if not Package().windows:
ZlibPackage().build()
SqlitePackage().build()
Expand Down
6 changes: 4 additions & 2 deletions ccdc/thirdparty/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def ubuntu_version(self):

@property
def platform(self):
if sys.platform.startswith('linux'):
return 'linux'
if not self.use_distribution_in_base_name:
return sys.platform
if not self.linux:
Expand Down Expand Up @@ -138,8 +140,8 @@ def output_base_name(self):
self.name,
self.version,
]
if 'BUILD_BUILDNUMBER' in os.environ:
components.append(os.environ['BUILD_BUILDNUMBER'])
if 'GITHUB_RUN_NUMBER' in os.environ:
components.append(os.environ['GITHUB_RUN_NUMBER'])
else:
components.append('do-not-use-me-developer-version')
components.append(self.platform)
Expand Down
74 changes: 0 additions & 74 deletions common-tasks.yml

This file was deleted.