Repository: activeviam/jdk4py (language: python)

Issue:
Add missing license classifier
Close #14.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml
index ca679e6..66f2073 100644
--- a/.github/workflows/deployment.yaml
+++ b/.github/workflows/deployment.yaml
@@ -18,8 +18,14 @@ jobs:
 
       - uses: actions/setup-python@v2
         with:
+          architecture: x64
           python-version: 3.8
-          architecture: "x64"
+
+      - name: Install Poetry
+        run: pip install poetry
+
+      - name: Install Python dependencies
+        run: poetry install
 
       - name: Set environment variables
         run: python scripts/set_environment.py
@@ -29,33 +35,20 @@ jobs:
           distribution: adopt
           java-version: ${{ env.JAVA_VERSION }}
 
-      # Install Poetry
-      - if: matrix.os == 'windows-latest'
-        name: Install Poetry [Windows]
-        run: pip install poetry
-      - if: matrix.os != 'windows-latest'
-        name: Install Poetry [Ubuntu/macOS]
-        run: pip3 install poetry
-
-      - name: Install Python dependencies
-        run: poetry install
-
-      - if: matrix.os == 'ubuntu-latest'
-        name: Build source wheel
-        run: poetry run python setup.py sdist
-
       - name: Build JDK
         run: poetry run python scripts/build_jdk.py
 
-      - name: Build wheel
+      - name: Build Python wheel
         env:
           JDK4PY_BUILD_PLATFORM: ${{ matrix.os }}
-        run: poetry run python setup.py bdist_wheel --build-number ${{ env.JDK4PY_BUILD_NUMBER }}
+        shell: bash
+        run: poetry run python setup.py bdist_wheel --build-number $JDK4PY_BUILD_NUMBER
 
-      - uses: actions/upload-artifact@v2
-        with:
-          name: jdk4py-${{ matrix.os }}.whl
-          path: dist/jdk4py-*.whl
+      - name: Deploy to PyPI
+        env:
+          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
+        shell: bash
+        run: poetry run twine upload dist/jdk4py-*.whl --username __token__ --password "$TWINE_PASSWORD"
 
       - uses: conda-incubator/setup-miniconda@v2
         with:
@@ -63,59 +56,16 @@ jobs:
           conda-build-version: 3.20.0
 
       - name: Build Conda package
-        run: conda build --output-folder dist . --no-anaconda-upload --debug
-
-      - uses: actions/upload-artifact@v2
-        with:
-          name: jdk4py-${{ matrix.os }}.tar.bz2
-          path: dist/*/jdk4py-*.bz2
-
-      # Deploy Conda package to artifactory.
-      - name: Upload Conda package [Linux]
-        if: matrix.os == 'ubuntu-latest'
-        env:
-          ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
-          ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
-        run: |
-          ls dist/linux-64/jdk4py-*.tar.bz2 | \
-          while read filepath; do
-            echo Uploading ${filepath}
-            curl --fail --user $ARTIFACTORY_USERNAME:$ARTIFACTORY_PASSWORD --upload-file ${filepath} "$JDK4PY_CONDA_CHANNEL/linux-64/"
-          done
+        run: conda build --no-anaconda-upload --output-folder dist .
 
-      - name: Upload Conda package [macOS]
-        if: matrix.os == 'macos-latest'
+      - name: Upload Conda package
         env:
           ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
           ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
+        shell: bash
         run: |
-          ls dist/osx-64/jdk4py-*.tar.bz2 | \
+          ls dist/$CONDA_ARCH/jdk4py-*.tar.bz2 | \
           while read filepath; do
             echo Uploading ${filepath}
-            curl --fail --user $ARTIFACTORY_USERNAME:$ARTIFACTORY_PASSWORD --upload-file ${filepath} "$JDK4PY_CONDA_CHANNEL/osx-64/"
+            curl --fail --user "$ARTIFACTORY_USERNAME":"$ARTIFACTORY_PASSWORD" --upload-file ${filepath} "$JDK4PY_CONDA_CHANNEL/$CONDA_ARCH/"
           done
-
-      - name: Upload Conda package [Windows]
-        if: matrix.os == 'windows-latest'
-        env:
-          ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
-          ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
-        run: |
-          curl --fail --user ${env:ARTIFACTORY_USERNAME}:${env:ARTIFACTORY_PASSWORD} "${env:JDK4PY_CONDA_CHANNEL}/win-64/" --upload-file "dist\win-64\jdk4py-${env:JDK4PY_VERSION}-py37_0.tar.bz2"
-          curl --fail --user ${env:ARTIFACTORY_USERNAME}:${env:ARTIFACTORY_PASSWORD} "${env:JDK4PY_CONDA_CHANNEL}/win-64/" --upload-file "dist\win-64\jdk4py-${env:JDK4PY_VERSION}-py38_0.tar.bz2"
-          curl --fail --user ${env:ARTIFACTORY_USERNAME}:${env:ARTIFACTORY_PASSWORD} "${env:JDK4PY_CONDA_CHANNEL}/win-64/" --upload-file "dist\win-64\jdk4py-${env:JDK4PY_VERSION}-py39_0.tar.bz2"
-
-      # Deploy to PyPI
-      - if: matrix.os == 'windows-latest'
-        name: Deploy to PyPI [Windows]
-        env:
-          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
-        run:
-          | # Install twine with conda as poetry is broken after installing conda
-          conda install twine
-          twine upload dist/jdk4py-*.whl --username __token__ --password ${env:TWINE_PASSWORD}
-      - if: matrix.os != 'windows-latest'
-        name: Deploy to PyPI [Linux/macOS]
-        env:
-          TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
-        run: poetry run twine upload dist/jdk4py-*.whl --username __token__ --password $TWINE_PASSWORD
diff --git a/jdk4py/build_number.txt b/jdk4py/build_number.txt
index d00491f..0cfbf08 100644
--- a/jdk4py/build_number.txt
+++ b/jdk4py/build_number.txt
@@ -1,1 +1,1 @@
-1
+2
diff --git a/scripts/set_environment.py b/scripts/set_environment.py
index 7c2aeb0..99b12d3 100644
--- a/scripts/set_environment.py
+++ b/scripts/set_environment.py
@@ -1,10 +1,17 @@
 from os import environ
 from pathlib import Path
+from platform import system
 from typing import Mapping
 
 _PROJECT_DIRECTORY = Path(__file__).parent.parent
 _SOURCE_DIRECTORY = _PROJECT_DIRECTORY / "jdk4py"
 
+_SYSTEM_TO_CONDA_ARCH = {
+    "Darwin": "osx-64",
+    "Linux": "linux-64",
+    "Windows": "win-64",
+}
+
 
 def set_env_variables_in_github_job(variables: Mapping[str, str]):
     # See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable.
@@ -21,6 +28,7 @@ def set_env_variables_in_github_job(variables: Mapping[str, str]):
 
     set_env_variables_in_github_job(
         {
+            "CONDA_ARCH": _SYSTEM_TO_CONDA_ARCH[system()],
             "JAVA_VERSION": java_version,
             "JDK4PY_BUILD_NUMBER": build_number,
             "JDK4PY_VERSION": ".".join((java_version, lib_version)),


Test patch:
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 2cac0cd..3c76aaf 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -18,8 +18,14 @@ jobs:
 
       - uses: actions/setup-python@v2
         with:
+          architecture: x64
           python-version: ${{ matrix.python }}
-          architecture: "x64"
+
+      - name: Install Poetry
+        run: pip install poetry
+
+      - name: Install Python dependencies
+        run: poetry install
 
       - name: Set environment variables
         run: python scripts/set_environment.py
@@ -29,24 +35,14 @@ jobs:
           distribution: adopt
           java-version: ${{ env.JAVA_VERSION }}
 
-      # Install Poetry
-      - if: matrix.os == 'windows-latest'
-        name: Install poetry [Windows]
-        run: pip install poetry
-      - if: matrix.os != 'windows-latest'
-        name: Install poetry [Ubuntu/macOS]
-        run: pip3 install poetry
-
-      - name: Install python dependencies
-        run: poetry install
-
       - name: Build JDK
         run: poetry run python scripts/build_jdk.py
 
-      - name: Build wheel
+      - name: Build Python wheel
         env:
-          JDK4PY_BUILD_PLATFORM: ubuntu-latest
-        run: poetry run python setup.py bdist_wheel --build-number ${{ env.JDK4PY_BUILD_NUMBER }}
+          JDK4PY_BUILD_PLATFORM: ${{ matrix.os }}
+        shell: bash
+        run: poetry run python setup.py bdist_wheel --build-number $JDK4PY_BUILD_NUMBER
 
       - name: Test
         run: poetry run pytest
@@ -55,6 +51,7 @@ jobs:
       - if: matrix.python == '3.8'
         uses: actions/upload-artifact@v2
         with:
+          if-no-files-found: error
           name: jdk4py-${{ matrix.os }}.whl
           path: dist/jdk4py-*.whl
 
@@ -66,8 +63,15 @@ jobs:
 
       - uses: actions/setup-python@v2
         with:
+          architecture: x64
           python-version: 3.8
-          architecture: "x64"
+
+      - name: Install Poetry
+        shell: bash
+        run: pip install poetry
+
+      - name: Install Python dependencies
+        run: poetry install
 
       - name: Set environment variables
         run: python scripts/set_environment.py
@@ -77,12 +81,6 @@ jobs:
           distribution: adopt
           java-version: ${{ env.JAVA_VERSION }}
 
-      - name: Install poetry
-        run: pip3 install poetry
-
-      - name: Install python dependencies
-        run: poetry install
-
       - name: Build JDK
         run: poetry run python scripts/build_jdk.py
 
@@ -92,4 +90,10 @@ jobs:
           conda-build-version: 3.20.0
 
       - name: Build Conda package
-        run: conda build --debug --no-anaconda-upload --output-folder dist .
+        run: conda build --no-anaconda-upload --output-folder dist .
+
+      - uses: actions/upload-artifact@v2
+        with:
+          if-no-files-found: error
+          name: conda-packages
+          path: dist/${{ env.CONDA_ARCH }}/jdk4py-*.tar.bz2