Skip to content

BLD-6874 GitHub workflow #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
106 changes: 106 additions & 0 deletions .github/workflows/build-conquest-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# A github workflow file to build conquest python
name: Build Conquest Python

on: # yamllint disable-line rule:truthy
workflow_dispatch:
inputs:
artifactory-push:
description: "Push result to Artifactory"
default: false
type: boolean
platforms:
description: 'Platform to build for, eg. '
options:
- 'rocky8'
- 'ubuntu'
- 'macos'
- 'windows'
push:
paths:
- '.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 }}" == "ubuntu" ]]; 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.artifactory-push }}
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.artifactory-push }}
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.

11 changes: 11 additions & 0 deletions build_conquest_python.py
Original file line number Diff line number Diff line change
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.