-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (73 loc) · 2.53 KB
/
Copy pathpackage.yml
File metadata and controls
91 lines (73 loc) · 2.53 KB
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
82
83
84
85
86
87
88
89
90
91
name: package pySubDisc
on: workflow_dispatch
jobs:
package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find SubDisc commit
run: |
echo "subdisc_commit=$(grep '^SubDisc' src/pysubdisc/VERSION | cut -d' ' -f 2)" >> $GITHUB_ENV
- name: Checkout SubDisc
uses: actions/checkout@v4
with:
repository: SubDisc/SubDisc
ref: ${{ env.subdisc_commit }}
path: ext/SubDisc
# We need to fetch the full history because the commit count is used
# to identify the SubDisc version.
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build SubDisc with Maven
run: mvn package
working-directory: ./ext/SubDisc
- name: Get SubDisc revision
run: |
echo "subdisc_revision=$(git -C ext/SubDisc rev-list HEAD --count)" >> $GITHUB_ENV
- name: Copy jar
run: |
mkdir -p src/pysubdisc/jars
cp ext/SubDisc/target/subdisc-gui.jar src/pysubdisc/jars/subdisc-gui-r${{ env.subdisc_revision }}.jar
- name: Add jar version info
run: |
sed -i -e s/9999/${{ env.subdisc_revision }}/ src/pysubdisc/VERSION
echo "pysubdisc_version=$(grep '^pySubDisc' src/pysubdisc/VERSION | cut -d' ' -f 2)" >> $GITHUB_ENV
echo "Using SubDisc commit ${{ env.subdisc_commit }}, revision ${{ env.subdisc_revision }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest
- name: Build package
run: python -m build
- name: Set up conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
activate-environment: ""
- name: Build conda package
run: |
conda install -y conda-build conda-verify
conda build conda
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: pysubdisc-wheel
path: |
dist/pysubdisc-${{ env.pysubdisc_version }}-py3-none-any.whl
dist/pysubdisc-${{ env.pysubdisc_version }}.tar.gz
retention-days: 2
- name: Upload conda package
uses: actions/upload-artifact@v4
with:
name: pysubdisc-conda
path: /usr/share/miniconda/conda-bld/noarch/pysubdisc-${{ env.pysubdisc_version }}-py_*.conda
retention-days: 2