-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (70 loc) · 2.53 KB
/
deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Deploy Conda packages and Python wheels
on:
push:
branches:
- main
jobs:
build:
name: Build on ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner:
- macos-13 # x64
- macos-14 # arm64
- ubuntu-24.04
- ubuntu-24.04-arm64 # GitHub-hosted larger runner in the ActiveViam organization.
- windows-2022
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-java-runtime
with:
python-version: "3.10"
- uses: ./.github/actions/build-python-wheel
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: jdk4py-${{ matrix.runner }}-python-wheel
path: dist/jdk4py-*.whl
- uses: ./.github/actions/build-conda-packages
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: jdk4py-${{ matrix.runner }}-conda-packages
path: dist/*/jdk4py-*.tar.bz2
publish:
environment: deployment
name: Publish Conda packages and Python wheels
needs: build
runs-on: ubuntu-24.04
permissions:
# Required for trusted publishing.
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist/
- name: List Conda packages and Python wheels
run: ls -R dist/
- name: Publish Conda packages
env:
JDK4PY_CONDA_CHANNEL_TOKEN: ${{ secrets.CONDA_CHANNEL_TOKEN }}
JDK4PY_CONDA_CHANNEL_URL: ${{ vars.CONDA_CHANNEL_URL }}
JDK4PY_CONDA_CHANNEL_USERNAME: ${{ vars.CONDA_CHANNEL_USERNAME }}
run: |
cd dist/
ls */jdk4py-*.tar.bz2 | \
while read filepath; do
echo Uploading ${filepath}
curl --fail --user "$JDK4PY_CONDA_CHANNEL_USERNAME":"$JDK4PY_CONDA_CHANNEL_TOKEN" --upload-file ${filepath} "$JDK4PY_CONDA_CHANNEL_URL/$(dirname $filepath)/"
done
shell: bash
# Conda packages are nested inside platform specific directories.
# Deleting all sub directories only leaves Python wheels in `dist/`.
# This is required to not confuse `twine upload` when `dist/*` is passed.
# See https://github.com/pypa/gh-action-pypi-publish/blob/36978192ca7715ea2e0d12e82d5518a651a9f739/twine-upload.sh#L208C43-L208C61.
- name: Keep only Python wheels
run: rm -R -- dist/*/
- name: Publish Python wheels
uses: pypa/gh-action-pypi-publish@release/v1