Repository: pjaselin/Cubist (language: python)

Issue:
Fix testpypi vs release pypi issues in pipeline
Was under the impression that Test PyPI could accept overwriting packages but need to investigate further


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 7f68880..22bda3f 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -39,12 +39,7 @@ jobs:
       - name: Add sys/time.h for Windows
         if: matrix.os == 'windows-latest'
         run: |
-          mv winsys/ cubist/sys
-
-      - name: Remove winsys folder for non-Windows OS
-        if: matrix.os != 'windows-latest'
-        run: |
-          rm -r winsys/
+          cp -r winsys/ cubist/sys
 
       - name: Install cibuildwheel
         run: python -m pip install cibuildwheel==2.16.2
@@ -52,7 +47,7 @@ jobs:
       - name: Build wheels
         run: python -m cibuildwheel --output-dir wheelhouse
 
-      - uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v4
         with:
           name: python-package-distributions
           path: ./wheelhouse/*.whl
@@ -73,17 +68,40 @@ jobs:
       run: |
         python -m pip install build
         python -m build
-    - uses: actions/upload-artifact@v3
+    - uses: actions/upload-artifact@v4
       with:
         name: python-package-distributions
         path: dist/*.tar.gz
 
+  publish-to-testpypi:
+    name: >-
+      Publish Python 🐍 distribution 📦 to TestPyPI
+    if: startsWith(github.ref, 'refs/tags/')
+    needs: [build_wheels, build_sdist]
+    runs-on: ubuntu-latest
+    environment:
+      name: testpypi
+      url: https://test.pypi.org/p/cubist/
+    permissions:
+      id-token: write
+
+    steps:
+    - name: Download all artifacts
+      uses: actions/download-artifact@v4
+      with:
+        name: python-package-distributions
+        path: dist/
+
+    - name: Publish distribution 📦 to Test PyPI
+      uses: pypa/gh-action-pypi-publish@release/v1
+      with:
+        repository-url: https://test.pypi.org/legacy/
+
   publish-to-pypi:
     # release only tagged commits to pypi / github
     name: >-
       Publish Python 🐍 distribution 📦 to PyPI
-    if: startsWith(github.ref, 'refs/tags/')
-    needs: [build_wheels, build_sdist]
+    needs: [publish-to-testpypi]
     runs-on: ubuntu-latest
     environment:
       name: release
@@ -93,7 +111,7 @@ jobs:
 
     steps:
     - name: Download all artifacts
-      uses: actions/download-artifact@v3
+      uses: actions/download-artifact@v4
       with:
         name: python-package-distributions
         path: dist/
@@ -101,7 +119,6 @@ jobs:
     - name: Publish distribution 📦 to PyPI
       uses: pypa/gh-action-pypi-publish@release/v1
 
-
   github-release:
     name: >-
       Sign the Python 🐍 distribution 📦 with Sigstore
@@ -116,7 +133,7 @@ jobs:
 
     steps:
     - name: Download all the dists
-      uses: actions/download-artifact@v3
+      uses: actions/download-artifact@v4
       with:
         name: python-package-distributions
         path: dist/
@@ -127,7 +144,7 @@ jobs:
           ./dist/*.tar.gz
           ./dist/*.whl
     - name: Upload Release Asset
-      uses: softprops/action-gh-release@v1
+      uses: softprops/action-gh-release@v2
       with:
         name: latest
         tag_name: latest
@@ -136,26 +153,3 @@ jobs:
           dist/*
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
-  publish-to-testpypi:
-    name: >-
-      Publish Python 🐍 distribution 📦 to TestPyPI
-    needs: [build_wheels, build_sdist]
-    runs-on: ubuntu-latest
-    environment:
-      name: testpypi
-      url: https://test.pypi.org/p/cubist/
-    permissions:
-      id-token: write
-
-    steps:
-    - name: Download all artifacts
-      uses: actions/download-artifact@v3
-      with:
-        name: python-package-distributions
-        path: dist/
-
-    - name: Publish distribution 📦 to Test PyPI
-      uses: pypa/gh-action-pypi-publish@release/v1
-      with:
-        repository-url: https://test.pypi.org/legacy/


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index a7c21a2..9c54659 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -45,12 +45,7 @@ jobs:
     - name: Add sys/time.h for Windows
       if: matrix.os == 'windows-latest'
       run: |
-        mv winsys/ cubist/sys
-
-    - name: Remove winsys folder for non-Windows OS
-      if: matrix.os != 'windows-latest'
-      run: |
-        rm -r winsys/
+        cp -r winsys/ cubist/sys
 
     - name: Install dependencies
       run: |