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

Split python packages #25

Merged
merged 4 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
99 changes: 80 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ env:


jobs:
tests:
name: Run tests
test:
name: Run test
runs-on: ubuntu-latest
steps:
- name: Read Configuration
Expand Down Expand Up @@ -57,26 +57,87 @@ jobs:
with:
version: 1.2.1

- name: Lint & test aserto package
- name: Run lint
run: |
cd packages/aserto
poetry install
poetry run pyright .

- name: Run tests
run: |
poetry run pytest -vv
cd ../..
release:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

- name: Lint & test aserto-idp package
run : |
cd packages/aserto-idp
poetry install
poetry run pyright .
poetry run pytest -vv
cd ../..
name: Release to pypi
steps:
- name: Read Configuration
uses: hashicorp/[email protected]
id: vault
with:
url: ${{ env.VAULT_ADDR }}
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/pypi "USERNAME" | POETRY_HTTP_BASIC_PYPI_USERNAME;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer works. Pypi stopped allowed package publishing using username/password.
You need to use the same logic as python-directory and python-authorizer: https://github.com/aserto-dev/python-directory/blob/main/.github/workflows/ci.yaml#L117

kv/data/pypi "PASSWORD" | POETRY_HTTP_BASIC_PYPI_PASSWORD;

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- name: Setup caching
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
.ext
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum', 'Depfile') }}
restore-keys: |
${{ runner.os }}-go-

- name: Install dependencies
run: |
mkdir -p $HOME/.ssh
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa
ssh-keyscan github.com >> $HOME/.ssh/known_hosts

git config --global url."[email protected]:".insteadOf https://github.com/
git config --global user.email "[email protected]"
git config --global user.name "Aserto Bot"

eval `ssh-agent`
ssh-add $HOME/.ssh/id_rsa

go run mage.go deps

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Build and push the python package
run: go run mage.go release

- name: Bump to the next version
run: go run mage.go bump patch

- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: 'Bump to next version'
add: 'pyproject.toml'
push: origin HEAD:main

- name: Lint & test flask-aserto package
run : |
cd packages/flask-aserto
poetry install
poetry run pyright .
poetry run pytest -vv
cd ../..
13 changes: 13 additions & 0 deletions .github/workflows/gitleaks-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: gitleaks-check

on: [pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: gitleaks-check
uses: aserto-dev/gitleaks-action@master
55 changes: 0 additions & 55 deletions DEVELOPER.md

This file was deleted.

5 changes: 5 additions & 0 deletions Depfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
go:
sver:
importPath: "github.com/aserto-dev/sver/cmd/sver"
version: "v1.3.13"
Loading
Loading