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

feat: python client package releases #195

Merged
merged 5 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"overrides": [
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/nx-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ jobs:
- uses: nrwl/nx-set-shas@v3
# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track main origin/main
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'

# - run: npx nx format:check
- name: install python tools
run: |
pip install poetry
- run: npx nx affected -t build --parallel=3
11 changes: 8 additions & 3 deletions .github/workflows/nx-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
with:
fetch-depth: 0
ref: ${{ github.ref }}

- uses: actions/setup-node@v4
with:
node-version: 18
Expand All @@ -92,14 +92,18 @@ jobs:
with:
python-version: '3.x'

- name: install twine
- name: install python tools
run: |
pip install twine
pip install poetry

- name: Mint pypi token
id: mint
uses: tschm/token-mint-action@v1.0.3

- name: Set version for non-js client packages
run: npx nx run-many -t set-version

- name: build
run: |
npx nx run-many -t build
Expand All @@ -109,10 +113,11 @@ jobs:
# Publish to npm,pypi with new nx release publish functionality
- run: |
npx nx release publish --verbose
name: release
name: publish
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: ${{ steps.mint.outputs.api-token }}
POETRY_PYPI_TOKEN_PYPI: ${{ steps.mint.outputs.api-token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} #publib-npm expects this
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
30 changes: 30 additions & 0 deletions clients/python/iam_client/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@affinidi-tdk/iam-client-python",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "{projectRoot}",
"projectType": "library",
"private": false,
"targets": {
"build": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "poetry build"
}
},
"set-version": {
"executor": "@affinidi-tdk/nx-tdk-tools:set-version",
"options": {
"packageName": "iam-client"
}
},
"nx-release-publish": {
"executor": "nx:run-commands",
"options": {
"cwd": "{projectRoot}",
"command": "poetry publish"
}
},
"tags": []
}
}
2 changes: 1 addition & 1 deletion clients/python/iam_client/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "affinidi_tdk_iam_client"
version = "1.0.0"
version = "1.18.0"
description = "Iam"
authors = ["Affinidi <info@affinidi.com>"]
license = "Apache-2.0"
Expand Down
5 changes: 5 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@
"codeCoverage": true
}
}
},
"@nx/js:tsc": {
"cache": true,
"dependsOn": ["^build"],
"inputs": ["default", "^default"]
}
}
}
Loading
Loading