Skip to content

Commit 5c8d7b4

Browse files
committed
updated build process
1 parent 6abe81b commit 5c8d7b4

File tree

4 files changed

+48
-24
lines changed

4 files changed

+48
-24
lines changed

.github/workflows/python-publish.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2424
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
2525
if: github.event_name == 'push'
2626
- name: Set up Python
27-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v3
2828
with:
29-
python-version: '3.x'
29+
python-version: '3.10'
3030
- name: Install dependencies
3131
id: set-version
3232
run: |
@@ -35,38 +35,26 @@ jobs:
3535
[ $GITHUB_EVENT_NAME == 'push' ] && VERSION+=b && VERSION+=$(($(git tag -l "*$VERSION*" | cut -db -f2 | sort -n | tail -1)+1))
3636
sed -ie "s/version = .*/version = $VERSION/" setup.cfg
3737
python -m pip install --upgrade pip
38+
pip install -r requirements.txt
3839
pip install build
3940
echo ::set-output name=version::$VERSION
4041
NAME="django_iris"-${VERSION}-py3-none-any
4142
echo ::set-output name=name::$NAME
4243
- name: Build package
43-
run: python -m build
44+
run: ./scripts/build-dist.sh
4445
- name: Publish package
45-
uses: pypa/gh-action-pypi-publish@release/v1.5
46+
uses: pypa/gh-action-pypi-publish@release/v1
4647
with:
4748
user: __token__
4849
password: ${{ secrets.PYPI_API_TOKEN }}
4950
- name: Create Beta Release
5051
id: create_release
51-
if: github.event_name == 'push'
52-
uses: actions/create-release@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
uses: softprops/action-gh-release@v1
5553
with:
56-
tag_name: ${{ steps.set-version.outputs.version }}
57-
release_name: ${{ steps.set-version.outputs.version }}
54+
tag_name: v${{ steps.set-version.outputs.version }}
5855
prerelease: ${{ github.event_name != 'release' }}
59-
- name: Upload Release Asset
60-
id: upload-release-asset
61-
uses: actions/upload-release-asset@v1
62-
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
with:
65-
upload_url: ${{ github.event_name == 'release' && github.event.release.upload_url || steps.create_release.outputs.upload_url }}
66-
asset_path: dist/${{ steps.set-version.outputs.name }}.whl
67-
asset_name: ${{ steps.set-version.outputs.name }}.whl
68-
asset_content_type: application/zip
69-
- uses: actions/checkout@v2
56+
files: dist/${{ steps.set-version.outputs.name }}.whl
57+
- uses: actions/checkout@v3
7058
if: github.event_name == 'release'
7159
with:
7260
ref: main

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.4.1/intersystems_iris-3.4.1-py3-none-any.whl
1+
https://github.com/intersystems-community/intersystems-irispython/releases/download/3.5.0/intersystems_iris-3.5.0-py3-none-any.whl

scripts/build-dist.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
packages=("intersystems_iris" "irisnative")
4+
for package in ${packages[@]};
5+
do
6+
rm -f ./$package
7+
package_path=`python -c "import importlib.util; print(importlib.util.find_spec('${package}').submodule_search_locations[0])"`
8+
ln -s $package_path ./$package
9+
done
10+
11+
set -eo pipefail
12+
13+
PROJECT="$( cd "$(dirname "$0")/.." ; pwd -P )"
14+
15+
PYTHON_BIN=${PYTHON_BIN:-python3}
16+
17+
echo "$PYTHON_BIN"
18+
19+
set -x
20+
21+
rm -rf "$PROJECT"/dist
22+
rm -rf "$PROJECT"/build
23+
mkdir -p "$PROJECT"/dist
24+
25+
cd "$PROJECT"
26+
$PYTHON_BIN setup.py sdist bdist_wheel
27+
28+
for package in ${packages[@]};
29+
do
30+
rm -f $package
31+
done
32+
rm -rf intersystems-irispython
33+
34+
set +x

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = django-iris
3-
version = 0.1.15
3+
version = 0.2.0
44
url = https://github.com/caretdev/django-iris
55
maintainer = CaretDev
66
maintainer_email = [email protected]
@@ -26,4 +26,6 @@ project_urls =
2626
[options]
2727
packages =
2828
django_iris
29+
intersystems_iris
30+
irisnative
2931
python_requires = >=3.8

0 commit comments

Comments
 (0)