Skip to content

Commit

Permalink
Upload msgpack-cxx from brew to PyPI (#1)
Browse files Browse the repository at this point in the history
* enable brew

Signed-off-by: Martijn Govers <[email protected]>

* get version from brew

Signed-off-by: Martijn Govers <[email protected]>

* get the package and tar

Signed-off-by: Martijn Govers <[email protected]>

* get the package and tar

Signed-off-by: Martijn Govers <[email protected]>

* exclude brew and install receipt from tarball

Signed-off-by: Martijn Govers <[email protected]>

* attempt build package

Signed-off-by: Martijn Govers <[email protected]>

* fix tar command

Signed-off-by: Martijn Govers <[email protected]>

* fix tar command

Signed-off-by: Martijn Govers <[email protected]>

* fix typo

Signed-off-by: Martijn Govers <[email protected]>

* repack tarball using artifacts

Signed-off-by: Martijn Govers <[email protected]>

* back to tarball

Signed-off-by: Martijn Govers <[email protected]>

* minor

Signed-off-by: Martijn Govers <[email protected]>

* test

Signed-off-by: Martijn Govers <[email protected]>

* fix tar command

Signed-off-by: Martijn Govers <[email protected]>

* minor

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* correctly create tarball wheelhouse

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* minor

Signed-off-by: Martijn Govers <[email protected]>

* minor

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* actually upload to pypi

* fix

Signed-off-by: Martijn Govers <[email protected]>

DCO Remediation Commit for Martijn Govers <[email protected]>

I, Martijn Govers <[email protected]>, hereby add my Signed-off-by to this commit: 0e2ab4e

Signed-off-by: Martijn Govers <[email protected]>

* fix classifiers

Signed-off-by: Martijn Govers <[email protected]>

* fix classifiers

Signed-off-by: Martijn Govers <[email protected]>

* remove long description from pyproject

Signed-off-by: Martijn Govers <[email protected]>

* cleanup

Signed-off-by: Martijn Govers <[email protected]>

* do not upload when on separate branch

Signed-off-by: Martijn Govers <[email protected]>

* single job with only workflow dispatch trigger

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* fix

Signed-off-by: Martijn Govers <[email protected]>

* revert copy statement

Signed-off-by: Martijn Govers <[email protected]>

* remove license

Signed-off-by: Tony Xiang <[email protected]>

* Create LICENSE

Signed-off-by: Tony Xiang <[email protected]>

* git ignore

Signed-off-by: Tony Xiang <[email protected]>

* use pypi package:

Signed-off-by: Tony Xiang <[email protected]>

* remove setup.py

Signed-off-by: Tony Xiang <[email protected]>

* modify ci

Signed-off-by: Tony Xiang <[email protected]>

* wheel

Signed-off-by: Tony Xiang <[email protected]>

* wheel

Signed-off-by: Tony Xiang <[email protected]>

* copy include

Signed-off-by: Tony Xiang <[email protected]>

* test

Signed-off-by: Tony Xiang <[email protected]>

* test

Signed-off-by: Tony Xiang <[email protected]>

* use namespace

Signed-off-by: Tony Xiang <[email protected]>

* use files

Signed-off-by: Tony Xiang <[email protected]>

* format

Signed-off-by: Tony Xiang <[email protected]>

* remove header

Signed-off-by: Tony Xiang <[email protected]>

* fix comments

Signed-off-by: Tony Xiang <[email protected]>

---------

Signed-off-by: Martijn Govers <[email protected]>
Signed-off-by: Tony Xiang <[email protected]>
Co-authored-by: Tony Xiang <[email protected]>
  • Loading branch information
mgovers and TonyXiang8787 authored Sep 20, 2023
1 parent ffe00d5 commit 32c7d4c
Show file tree
Hide file tree
Showing 13 changed files with 286 additions and 616 deletions.
4 changes: 0 additions & 4 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0

allowRemediationCommits:
individual: true
thirdParty: true
Expand Down
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0


version: 2
updates:
- package-ecosystem: "github-actions"
Expand Down
66 changes: 55 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0

name: Upload msgpack-cxx to PyPI

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
upload:

get-versions:
name: "Upload latest msgpack-cxx version to PyPI"
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -23,9 +18,58 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: x64

- name: Install dependencies
run: pip install build

- name: Enable brew
run: echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH

- name: Download msgpack-cxx
run: brew install msgpack-cxx

- name: Build msgpack-cxx
run:
ls /home/linuxbrew/.linuxbrew/Cellar/msgpack-cxx/6.1.0/
- name: Get latest version
id: version
run: echo "latest=$(brew list --version msgpack-cxx | sed -e 's/msgpack-cxx\s//')" >> $GITHUB_OUTPUT

- name: List version
run: echo "latest=${{ steps.version.outputs.latest }}"

- name: Get the msgpack-cxx contents
run: cp -r /home/linuxbrew/.linuxbrew/Cellar/msgpack-cxx/${{ steps.version.outputs.latest }}/include/* src/msgpack_cxx/include

- name: Set PyPI Version
run: echo "${{ steps.version.outputs.latest }}" >> PYPI_VERSION

- name: Show contents
run: ls -ahl src/msgpack_cxx/include

- name: Build wheel
run: python -m build --wheel --outdir wheelhouse .

- name: Test wheel
run: |
pip install wheelhouse/*
pip install pytest
pytest
- name: Keep Wheel file
uses: actions/upload-artifact@v3
with:
name: wheelhouse
path: ./wheelhouse/*.whl

- name: List assets
run: ls ./wheelhouse/ -al

- name: Upload wheels
if: github.event_name == 'workflow_dispatch'
run: |
pip install twine
echo "Publish to PyPI..."
twine upload --verbose wheelhouse/*
135 changes: 135 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/


.vscode
PYPI_VERSION

.idea/
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2022 Contributors to the Power Grid Model project <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0

repos:
- repo: https://github.com/fsfe/reuse-tool
rev: v1.0.0
Expand Down
8 changes: 0 additions & 8 deletions .reuse/dep5

This file was deleted.

Loading

0 comments on commit 32c7d4c

Please sign in to comment.