From c610d1ab157bb2e56ab0862b01cf09aa6706d9dc Mon Sep 17 00:00:00 2001 From: Antoine POPINEAU Date: Fri, 6 May 2022 17:26:34 +0200 Subject: [PATCH] Build 0.3.0. Trying out PyPI publishing from CI. --- .github/workflows/release.yml | 110 ++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..39c7b54 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,110 @@ +name: Continuous master build + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + lint: + strategy: + fail-fast: false + matrix: + python-version: [3.7, 3.8, 3.9, "3.10"] + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: .venv/ + key: virtualenv + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: "1.1.13" + - name: Run linters + run: | + poetry config virtualenvs.in-project true + poetry install + poetry run black --check . + poetry run mypy . + + build: + runs-on: ubuntu-20.04 + steps: + - name: Get release version + id: version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: .venv/ + key: virtualenv + - uses: actions/setup-python@v2 + with: + python-version: "3.10.4" + - uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: "1.1.13" + - name: Build artifacts + run: | + poetry config virtualenvs.in-project true + poetry install --no-dev + poetry build + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: 1p-${{ steps.version.outputs.VERSION }} + path: | + dist/onep-${{ steps.version.outputs.VERSION }}-py3-none-any.whl + dist/onep-${{ steps.version.outputs.VERSION }}.tar.gz + + package: + runs-on: ubuntu-20.04 + needs: [lint, build] + steps: + - name: Get release version + id: version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + path: dist/ + - name: Create release + uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + automatic_release_tag: tip + title: v${{ steps.version.outputs.VERSION }} + prerelease: true + files: dist/1p-${{ steps.version.outputs.VERSION }}/* + + publish: + runs-on: ubuntu-20.04 + needs: [package] + steps: + - name: Get release version + id: version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: .venv/ + key: virtualenv + - uses: actions/setup-python@v2 + with: + python-version: "3.10.4" + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + path: dist/ + - uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: "1.1.13" + - name: Publish to PyPI + run: | + mv dist/1p-${{ steps.version.outputs.VERSION }}/* dist/ + poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} + poetry publish diff --git a/pyproject.toml b/pyproject.toml index bc2a58a..b002791 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "onep" -version = "0.2.0" +version = "0.3.0" description = "1Password CLI helper" authors = ["Antoine POPINEAU "]