palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.61k stars 283 forks source link

Move CI to Github Actions #803

Closed goanpeca closed 4 years ago

goanpeca commented 4 years ago

Add win, mac and linux testing for Python 2.7, 3.6, 3.7 and 3.8

goanpeca commented 4 years ago

@gatesn could we disable appveyor and circle ci webhooks? Also could we disable the "required" checks from the PRs?

https://github.com/palantir/python-language-server/settings/hooks (we do not have access to that :-). )

Thanks!

ccordoba12 commented 4 years ago

@goanpeca, please restore the CircleCI checks and simply make them pass so I can merge this one.

goanpeca commented 4 years ago

@goanpeca, please restore the CircleCI checks and simply make them pass so I can merge this one.

They are restored, but they simply stoped running. Other PRs seem to be facing the same issue.

jroitgrund commented 4 years ago

@goanpeca @ccordoba12 I removed the circle and appveyor webhooks, and made the checks non-required. Let's fix-up this branch to unblock further PRs.

goanpeca commented 4 years ago

@jroitgrund Thanks!, actually we need to keep the circleci hooks, since there we have the job in charge of making a release when a new tag is published. And the release process is tied to some passwords that I assume were configured as environment variables on circle ci.

I could move the process to Github actions as well, but some extra configuration would be needed on the secrest sections of setttings on this repo so we can use those PyPI passwords/tokens in the github action workflow.

jroitgrund commented 4 years ago

@gatesn do you have a copy of the secrets from circle so we can add them as github actions secrets?

gatesn commented 4 years ago

They should be stored in passwords.y.l

jroitgrund commented 4 years ago

@goanpeca I added PIPY_HOST, PIPY_PASSWORD, and PIPY_USERNAME as GH secrets, so I think all we need is a GitHub action mirroring https://github.com/palantir/python-language-server/blob/develop/.circleci/config.yml#L36-L41

goanpeca commented 4 years ago

Thanks @jroitgrund

I will take a look

ccordoba12 commented 4 years ago

@jroitgrund, could you also add TWINE_USERNAME and TWINE_PASSWORD?

I think that it's easier to use twine to upload the wheel and tarball instead of setup.py, and those env vars are needed for that according to

https://twine.readthedocs.io/en/latest/#environment-variables

jroitgrund commented 4 years ago

Done! We were previously publishing via https://upload.pypi.org/legacy/ but I guess we won't need to anymore if we switch to twine.

ccordoba12 commented 4 years ago

Thanks a lot @jroitgrund! I'll try to add support for twine on Github actions tonight (CDT) if @goanpeca doesn't it add before.

goanpeca commented 4 years ago

@jroitgrund from a security standpoint, it would be better to use tokens from PyPI, instead of username and password.

If you go to https://pypi.org/manage/project/python-language-server/settings/

(Showing an example of another project)

Screen Shot 2020-09-10 at 9 37 09

And then clicking on Create a Token ...

image

That way we can use this step on the Github Workflow

    - name: Publish Client release
      env:
        TWINE_USERNAME: __token__
        TWINE_PASSWORD: ${{ secrets.PYPI_PYLS_TOKEN }}
      run: |
        python -m twine upload dist/*

No PIPY_HOST, PIPY_PASSWORD, and PIPY_USERNAME needs to be set/exposed, only PYPI_PYLS_TOKEN and it will only have access to publish the python-language-server package.

jroitgrund commented 4 years ago

Good call, done.

goanpeca commented 4 years ago

Thanks @jroitgrund! Is the name PYPI_PYLS_TOKEN? I just pull that out of the blue.

jroitgrund commented 4 years ago

Yep.

ccordoba12 commented 4 years ago

0.35.0 is finally out!

https://pypi.org/project/python-language-server/0.35.0/

Thanks @goanpeca for the tips and @jroitgrund for setting things up on your side.