Repository: richcat-dev/richcat (language: python)

Issue:
TestPyPIへのアップロードワークフローを修正する
現状だと、再アップロードの仕組みが無い＆PyPIは同じバージョンでの再アップロードができないので、良しなにバージョン変更して再アップロードする仕組みが欲しい


Discussion / hints:
バージョン命名規則：

> ```
> X.YaN   # Alpha release
> X.YbN   # Beta release
> X.YrcN  # Release Candidate
> X.Y     # Final release
> ```
> 引用：https://www.python.org/dev/peps/pep-0440/#pre-releases

Fix patch:
diff --git a/richcat-play-env/Dockerfile b/richcat-play-env/Dockerfile
index a1f5e3a..86a2f65 100644
--- a/richcat-play-env/Dockerfile
+++ b/richcat-play-env/Dockerfile
@@ -4,7 +4,7 @@ FROM python:3.7
 # Environment
 ENV HOME /home
 WORKDIR $HOME
-COPY .bashrc requirements.txt $HOME/
+COPY .bashrc $HOME/
 
 # Installl commands
 RUN apt-get update && apt-get upgrade -y \
@@ -12,6 +12,4 @@ RUN apt-get update && apt-get upgrade -y \
     less
 
 # Install Python libraries
-RUN pip install --upgrade pip \
-    && pip install -r $HOME/requirements.txt \
-    && pip install -i https://test.pypi.org/simple/ richcat
\ No newline at end of file
+RUN pip install --upgrade pip
\ No newline at end of file
diff --git a/richcat-play-env/requirements.txt b/richcat-play-env/requirements.txt
deleted file mode 100644
index 147672b..0000000
--- a/richcat-play-env/requirements.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-# Base libraries
-rich
-
-# For Sphinx
-sphinx
-sphinx-autobuild
-sphinx_rtd_theme
-
-# Testing
-pytest
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/upload-to-testpypi.yml b/.github/workflows/upload-to-testpypi.yml
index 6456c3e..e4eea7a 100644
--- a/.github/workflows/upload-to-testpypi.yml
+++ b/.github/workflows/upload-to-testpypi.yml
@@ -10,6 +10,7 @@ jobs:
     runs-on: ubuntu-latest
 
     outputs:
+      version: ${{ steps.get_version_in_code.outputs.version_in_code }}
       version_matched: ${{ steps.compare_version.outputs.matched }}
 
     steps:
@@ -42,6 +43,13 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v2
 
+      - name: Get pre-release count
+        id: get_pre_release_count
+        run: echo "::set-output name=pre_release_count::$(curl -s https://test.pypi.org/project/richcat/#history | grep -coE /project/richcat/0.5.0rc)"
+
+      - name: Set pre-release version
+        run: sed -i "s/${{ needs.check_version.outputs.version }}/${{ needs.check_version.outputs.version }}rc${{ steps.get_pre_release_count.outputs.pre_release_count }}/g" ./richcat/__information__.py
+
       - name: Set up Python
         uses: actions/setup-python@v2
         with: