Skip to content

Commit

Permalink
Merge pull request #70 from necessary129/python-packaging-3
Browse files Browse the repository at this point in the history
Add Python wheel building + Publishing workflow
  • Loading branch information
svkeerthy authored Sep 24, 2023
2 parents 73ee6c1 + 38c3e51 commit d36ac2c
Show file tree
Hide file tree
Showing 26 changed files with 439 additions and 66 deletions.
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "LLVM Manylinux",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "ghcr.io/necessary129/manylinux2014-llvm:12-x86_64"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
59 changes: 59 additions & 0 deletions .github/workflows/upload-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Upload to PyPI

on:
release:
types:
- published
workflow_dispatch:
inputs:
pypi_repo:
description: 'Repo to upload to (testpypi or pypi)'
default: 'testpypi'
required: true
type: choice
options:
- testpypi
- pypi

jobs:
build_wheels:
uses: ./.github/workflows/wheel.yml


build_sdist:
runs-on: ubuntu-latest
container: ghcr.io/necessary129/manylinux2014-llvm:12-x86_64
steps:
- uses: actions/checkout@v3

- name: Build IR2Vec
run: bash Manylinux2014_Compliant_Source/pkg/build.sh

- name: Build sdist
run: cd Manylinux2014_Compliant_Source/pkg && pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: Manylinux2014_Compliant_Source/pkg/dist/*.tar.gz


upload_pypi:
permissions:
id-token: write
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.8.5
with:
repository-url: https://test.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo != 'pypi' }}

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.5
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}
Loading

0 comments on commit d36ac2c

Please sign in to comment.