Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull PyPI secrets from Vault #1696

Merged
merged 4 commits into from
Apr 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

- name: Sleep
run: sleep 60
run: sleep 120

- name: Test install from Test PyPI
run: |
Expand All @@ -53,6 +53,9 @@ jobs:
name: Publish Nebari on PyPi
runs-on: ubuntu-latest
needs: test-pypi
permissions:
id-token: write
contents: read

steps:
- name: Set up python
Expand All @@ -71,7 +74,19 @@ jobs:
- name: Build source and binary
run: python -m build --sdist --wheel .

- name: Retrieve secret from Vault
uses: hashicorp/vault-action@v2.5.0
with:
method: jwt
url: "https://quansight-public-vault-fe415d04.c219cf75.z1.hashicorp.cloud:8200"
namespace: "admin/quansight"
role: "repository-nebari-dev-nebari-role"
secrets: |
kv/data/repository/nebari-dev/nebari/shared_secrets PYPI_USERNAME | PYPI_USERNAME;
kv/data/repository/nebari-dev/nebari/shared_secrets PYPI_PASSWORD | PYPI_PASSWORD;

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
user: ${{ env.PYPI_USERNAME }}
password: ${{ env.PYPI_PASSWORD }}