From 8f7b493f2292738326e02978786368d782b74363 Mon Sep 17 00:00:00 2001 From: wytamma Date: Thu, 1 Sep 2022 11:23:44 +1000 Subject: [PATCH] :rocket: added publish script --- .github/workflows/publish.yaml | 54 ++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..bd6b24e --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,54 @@ +name: publish +on: + push: + tags: + - 'v*.*.*' +jobs: + build: + runs-on: ubuntu-latest + steps: + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + virtualenvs-create: true + virtualenvs-in-project: true + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + #---------------------------------------------- + # install your root project, if required + #---------------------------------------------- + - name: Install library + run: poetry install --no-interaction + - name: Build library + run: poetry build + - name: Publish library + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + run: | + poetry config pypi-token.pypi $PYPI_TOKEN + poetry publish \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8811e1f..b3f17e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "mccoy" -version = "0.1.0" +version = "0.1.1" description = "" authors = ["Wytamma Wirth ", "Simon Mutch ", "Rob Turnbull "] readme = "README.md"