Skip to content

Commit

Permalink
Merge pull request #27 from RIMS-Code/packaging_and_autorelease
Browse files Browse the repository at this point in the history
Packaging and autorelease
  • Loading branch information
trappitsch authored Jun 6, 2024
2 parents 31d00c9 + cc87259 commit 048ce1e
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
rye pin ${{ matrix.python-version }}
rye sync
- name: Run Tests for python interface
run: rye run test
run: rye test
- name: Run Lint on one python
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
run: rye lint
Expand Down
78 changes: 71 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,81 @@ env:
jobs:
build-linux:
name: Release on PyPi
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install the latest version of rye
uses: eifinger/setup-rye@v2
uses: eifinger/setup-rye@v3
- name: Sync Rye
run: |
rye pin ${{ env.PYTHON_VERSION }}
rye sync
- name: Build and release the controller
rye pin ${{ env.PYTHON_VERSION }} --relaxed
rye sync --all-features
# - name: Build and release on PyPi
# run: |
# rye build
# rye publish --token ${{ secrets.PYPI_TOKEN }} --yes
- name: Package Linux App
run: |
rye build
rye publish --token ${{ secrets.PYPI_TOKEN }} --yes
rye run box package
mv target/release/rimsschemedrawer target/release/rimsschemedrawer-linux
- name: Release
uses: softprops/action-gh-release@v2
with:
files:
${{ github.workspace }}/target/release/rimsschemedrawer-linux
tag_name: ${{ github.ref_name }}
name: RIMSSchemeDrawer ${{ github.ref_name }}
body_path: ${{ github.workspace }}/release_text.md

build-windows:
needs: build-linux
name: Package GUI for Windows and add to Release
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install .
pip install box-packager
pip install build
- name: Package Windows App
run: |
box init -q -b build
rye run box package
mv target/release/rimsschemedrawer.exe target/release/rimsschemedrawer-windows.exe
- name: Add to Release
uses: softprops/action-gh-release@v1
with:
files:
target/release/rimsschemedrawer-windows.exe
tag_name: ${{ github.ref_name }}

build-macos:
needs: build-linux
name: Package GUI for MacOS and add to Release
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rye
uses: eifinger/setup-rye@v3
- name: Sync Rye
run: |
rye pin ${{ env.PYTHON_VERSION }} --relaxed
rye sync --all-features
- name: Package MacOS App
run: |
rye run box package
mv target/release/rimsschemedrawer target/release/rimsschemedrawer-macos
- name: Add to Release
uses: softprops/action-gh-release@v1
with:
files:
target/release/rimsschemedrawer-macos
tag_name: ${{ github.ref_name }}
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rimsschemedrawer"
version = "3.0.0.dev4"
version = "3.0.0rc1"
description = "Drawing of RIMS schemes in python and/or with a Python GUI."
authors = [
{ name = "Reto Trappitsch", email = "[email protected]" }
Expand Down Expand Up @@ -45,10 +45,10 @@ dev-dependencies = [
"pytest-cov>=4.1.0",
"requests>=2.31.0",
"rttools @ git+https://github.com/trappitsch/rttools",
"box-packager>=0.2.0",
]

[tool.rye.scripts]
test = "pytest"
test_cov = "pytest --cov --cov-report xml"

[tool.hatch.metadata]
Expand Down
Empty file added release_text.md
Empty file.
17 changes: 17 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ attrs==23.2.0
# via hypothesis
babel==2.15.0
# via mkdocs-material
box-packager==0.2.0
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via box-packager
# via mkdocs
# via mkdocstrings
# via rich-click
colorama==0.4.6
# via box-packager
# via griffe
# via mkdocs-material
contourpy==1.2.1
Expand Down Expand Up @@ -54,6 +58,8 @@ markdown==3.6
# via mkdocs-material
# via mkdocstrings
# via pymdown-extensions
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via jinja2
# via mkdocs
Expand All @@ -62,6 +68,8 @@ markupsafe==2.1.5
matplotlib==3.9.0
# via rimsschemedrawer
# via rttools
mdurl==0.1.2
# via markdown-it-py
mergedeep==1.3.4
# via mkdocs
# via mkdocs-get-deps
Expand Down Expand Up @@ -116,6 +124,7 @@ pyarrow==16.1.0
# via rttools
pygments==2.18.0
# via mkdocs-material
# via rich
pymdown-extensions==10.8.1
# via mkdocs-material
# via mkdocstrings
Expand Down Expand Up @@ -149,15 +158,23 @@ regex==2024.5.15
# via mkdocs-material
requests==2.32.2
# via mkdocs-material
rich==13.7.1
# via box-packager
# via rich-click
rich-click==1.8.2
# via box-packager
rttools @ git+https://github.com/trappitsch/rttools@b01d4af6f767190a22e22a953e9d4ce18c7b5d9f
scipy==1.13.1
# via rttools
six==1.16.0
# via python-dateutil
sortedcontainers==2.4.0
# via hypothesis
tomlkit==0.12.5
# via box-packager
typing-extensions==4.12.0
# via pint
# via rich-click
tzdata==2024.1
# via pandas
urllib3==2.2.1
Expand Down

0 comments on commit 048ce1e

Please sign in to comment.