Skip to content

Commit

Permalink
WiP: Publishing: Experiment with Docker image for manylinux
Browse files Browse the repository at this point in the history
  • Loading branch information
corey committed Jan 13, 2024
1 parent af6ad8a commit 8c2eb0f
Showing 1 changed file with 126 additions and 16 deletions.
142 changes: 126 additions & 16 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ on:
options:
- true
- false
# id:
# description: Set the run ID to a known value
# required: false
# type: number
env:
om_ver_file: om_version
origen_ver_file: origen_version
Expand All @@ -78,30 +82,134 @@ jobs:
lock_master:
needs: [precheck]
runs-on: ubuntu-latest
permissions: write-all
# steps:
# - name: Check Master Lock Status
# uses: actions/github-script@v7
# with:
# github-token: ${{ secrets.O2_PAT }}
# script: |
# const result = await github.rest.repos.getBranchProtection({
# owner: context.repo.owner,
# repo: context.repo.repo,
# branch: 'master'
# })
# console.log(result)
# console.log(result.lock_branch.enabled)
# if (result.lock_branch.enabled) {
# core.setFailed('Master branch is unexpectedly locked!')
# }

# const check_master_url = "https://api.github.com/repos/${{ github.repository }}/branches/BRANCH/protection"
# const result = await github.request(url)
# console.log(result)
# - id: lock-master
# uses: actions/github-script@v7
# if: ${{ always() }}
# with:
# script: |
# github.rest.repo.

build_manylinux:
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }}
needs: [lock_master]
runs-on: ubuntu-latest
container:
image: pypa/manylinux2010_x86_64
steps:
- name: Check Master Lock Status
uses: actions/github-script@v7
- uses: actions/checkout@v2

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
script: |
const result = await github.rest.repos.getBranchProtection({
owner: context.repo.owner,
repo: context.repo.repo,
branch: 'master'
})
console.log(result)
console.log(result.lock_branch.enabled)
if (result.lock_branch.enabled) {
core.setFailed('Master branch is unexpectedly locked!')
}
toolchain: ${{ fromJSON(vars.RUST_VERSION) }}
rustflags:

- name: Override Project Rust Version
run: rustup override set ${{ fromJSON(vars.RUST_VERSION) }}

- name: Check Rust Version
run: |
rustc --version
cargo --version
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python Version
run: python -c "import sys; print(sys.version)"

- name: Install Poetry
run: |
pip install poetry==1.3.2
poetry --version
- name: install libdbus
run: |
sudo apt update
sudo apt install libdbus-1-dev
if: contains(matrix.os, 'ubuntu')
- name: Build Origen Metal Python Package
working-directory: python/origen_metal
run: poetry build --format wheel

- name: Display Dist Directory
working-directory: python/origen_metal/dist
run: ls

- name: Upload Origen Metal Python Package Artifact
uses: actions/upload-artifact@v3
with:
name: om_wheels
path: python/origen_metal/dist/origen_metal*

- name: Get OM Python Package Version
working-directory: python/origen_metal
run: poetry version -s > ${{ env.om_ver_file }}

- name: Upload OM Python Package Version
uses: actions/upload-artifact@v3
with:
name: ${{ env.om_ver_file }}
path: python/origen_metal/${{ env.om_ver_file }}

- name: Build Origen Python Package
working-directory: python/origen
run: poetry build --format wheel

- name: Display Dist Directory
working-directory: python/origen/dist
run: ls

- name: Upload Origen Python Package Artifact
uses: actions/upload-artifact@v3
with:
name: origen_wheels
path: python/origen/dist/origen*

- name: Get Origen Python Package Version
working-directory: python/origen
run: poetry version -s > ${{ env.origen_ver_file }}

- name: Upload Origen Python Package Version
uses: actions/upload-artifact@v3
with:
name: ${{ env.origen_ver_file }}
path: python/origen/${{ env.origen_ver_file }}

build:
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.SUPPORTED_OS) }}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS) }}
needs: [lock_master]
# Temporarily disable this while working with manylinux image
if: ${{ 0 == 1 }}

runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -334,7 +442,7 @@ jobs:
password: ${{ secrets.PYPI_ORIGEN_API_TOKEN }}
verify-metadata: false
verbose: true

release:
needs: build
runs-on: ubuntu-latest
Expand Down Expand Up @@ -408,4 +516,6 @@ jobs:
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- run: echo Begin Clean Up...
- run: echo Begin Clean Up...

# - name: Unlock Master Branch

0 comments on commit 8c2eb0f

Please sign in to comment.