Skip to content

Commit

Permalink
update deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaminsk committed Apr 23, 2021
1 parent 352b42a commit 5ef0d84
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
13 changes: 10 additions & 3 deletions .github/pipwinmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,15 @@ def adjust_version(url):
version = m.group(1)
assert version is not None

with urlopen('{}/{}'.format(url, package_name)) as uh:
pip = uh.read().decode()
try:
with urlopen('{}/{}'.format(url, package_name)) as uh:
pip = uh.read().decode()
except HTTPError as err:
if err.code == 404:
pip = '\n'
else:
raise

post = 0
for m in finditer(r'{}-{}\.post([0-9]+)\.tar\.gz'.format(package_regex, escape(version)), pip):
post = max(post, int(m.group(1)))
Expand Down Expand Up @@ -78,7 +85,7 @@ def run():
adjust_version(url)

if os.name == 'posix':
environ['PATH'] = '/usr/local/opt/bison/bin' + pathsep + environ["PATH"]
environ['PATH'] = '/usr/local/opt/bison/bin' + pathsep + '/usr/local/opt/[email protected]/bin' + pathsep + environ["PATH"]
environ['MACOSX_DEPLOYMENT_TARGET'] = '10.9'
args = ['pip', 'wheel', '-v', '--no-deps', '-w', 'dist']
if idx is not None:
Expand Down
2 changes: 1 addition & 1 deletion .github/ppa-wip/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ for act in "${@}"; do
;;
changes)
VERSION="$(sed -n '/#define CLINGCON_VERSION "/s/.*"\([0-9]\+\.[0-9\+]\.[0-9]\+\)".*/\1/p' ../../libclingcon/clingcon.h)"
BUILD=$(curl -sL http://ppa.launchpad.net/potassco/${ref}/ubuntu/pool/main/c/clingcon/ | sed -n "/${rep}[0-9]\+\.dsc/s/.*${rep}\([0-9]\+\).*/\1/p" | sort -rn | head -1)
BUILD=$(curl -sL http://ppa.launchpad.net/potassco/${ref}/ubuntu/pool/main/c/clingcon/ | sed -n "/${VERSION//./\\.}-${rep}[0-9]\+\.dsc/s/.*${rep}\([0-9]\+\).*/\1/p" | sort -rn | head -1)
cat > ${rep}/debian/changelog <<EOF
clingcon (${VERSION}-${rep}$[BUILD+1]) ${rep}; urgency=medium
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conda-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
wip:
description: 'Publish work in progress package.'
required: false
default: true
default: 'true'

jobs:
build:
Expand Down Expand Up @@ -54,15 +54,15 @@ jobs:
conda list
- name: publish conda package (wip)
if: ${{ github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'true' }}
shell: pwsh
run: |
python .github/conda.py
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}

- name: publish conda package (release)
if: ${{ !github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'false' }}
shell: pwsh
run: |
python .github/conda.py --release
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pipsource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
wip:
description: 'Publish work in progress package.'
required: false
default: true
default: 'true'

jobs:
build_packages:
Expand All @@ -22,12 +22,12 @@ jobs:
python3 -m pip install --user --upgrade scikit-build
- name: Install prerequisites (wip)
if: ${{ github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'true' }}
run: |
python3 -m pip install --user --extra-index-url https://test.pypi.org/simple/ clingo-cffi
- name: Install prerequisites (release)
if: ${{ !github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'false' }}
run: |
python3 -m pip install --user clingo
Expand All @@ -37,11 +37,11 @@ jobs:
submodules: recursive

- name: Build source package (wip)
if: ${{ github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'true' }}
run: python3 .github/pipsource.py

- name: Publish package to TestPyPI (wip)
if: ${{ github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'true' }}
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand All @@ -50,11 +50,11 @@ jobs:
repository_url: https://test.pypi.org/legacy/

- name: Build source package (release)
if: ${{ !github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'false' }}
run: python3 .github/pipsource.py --release

- name: Publish package to TestPyPI (release)
if: ${{ !github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'false'}}
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/pipwinmac-wip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ on:
wip:
description: 'Publish work in progress package.'
required: false
default: true
default: 'true'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-10.15
Expand All @@ -34,7 +35,7 @@ jobs:
pip install --user cffi scikit-build cmake ninja twine
- name: Compile and upload wheels (wip)
if: ${{ github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'true' }}
run: python .github/pipwinmac.py
env:
TWINE_NON_INTERACTIVE: True
Expand All @@ -43,7 +44,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

- name: Compile and upload wheels (release)
if: ${{ !github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'false' }}
run: python .github/pipwinmac.py --release
env:
TWINE_NON_INTERACTIVE: True
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/ppa-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ on:
wip:
description: 'Publish work in progress package.'
required: false
default: true
default: 'true'

jobs:
build_packages:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
distribution: [focal, bionic]

Expand All @@ -36,13 +37,13 @@ jobs:
POTASSCO_PPA_GPGKEY: ${{ secrets.POTASSCO_PPA_GPGKEY }}

- name: Build deb and source package (wip)
if: ${{ github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'true' }}
run: |
cd .github/ppa-wip
./build.sh wip "$distribution" create sync changes build put
- name: Build deb and source package (release)
if: ${{ !github.event.inputs.wip }}
if: ${{ github.event.inputs.wip == 'false' }}
run: |
cd .github/ppa-wip
./build.sh stable "$distribution" create sync changes build put

0 comments on commit 5ef0d84

Please sign in to comment.