-
Notifications
You must be signed in to change notification settings - Fork 1
Over-haul of CI #166
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
Over-haul of CI #166
Changes from all commits
c47007b
f260ef5
298430a
f90dddb
810424b
4f22c45
9327efe
981ad11
6542f48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,9 @@ | ||
| --- | ||
| name: Release | ||
|
|
||
| on: push | ||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| pypi: | ||
| name: Build and publish package to PyPI | ||
| runs-on: ubuntu-latest | ||
| if: startsWith(github.event.ref, 'refs/tags') | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Generate grammar | ||
| run: | | ||
| python -m pip install -r requirements.txt | ||
| poe generate | ||
| - name: Build package | ||
| run: | | ||
| python -m pip install build twine | ||
| cd cratedb_sqlparse_py | ||
| python -m build | ||
| twine check dist/{*.tar.gz,*.whl} | ||
| - name: Publish package to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| packages-dir: cratedb_sqlparse_py/dist/ | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||
| release_javascript: | ||
| uses: ./.github/workflows/release_javascript.yml | ||
| release_python: | ||
| uses: ./.github/workflows/release_python.yml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: Publish Package to npmjs | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| # Setup .npmrc file to publish to npm | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Generate grammar | ||
| run: | | ||
| python -m pip install -r requirements.txt | ||
| python setup_grammar.py javascript | ||
|
|
||
| - name: Set VERSION from tag | ||
| run: | | ||
| npm version ${GITHUB_REF#refs/*/v} | ||
|
|
||
| - run: npm build | ||
|
|
||
| - run: npm publish --provenance --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||||||||||||||||||||||
| name: Publish python parser to pypi | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||
| workflow_call: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||
| name: Build and publish package to PyPI | ||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Set up Python | ||||||||||||||||||||||||||||
| uses: actions/setup-python@v5 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| python-version: '3.12' | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - name: Generate grammar | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| python -m pip install -r requirements.txt | ||||||||||||||||||||||||||||
| python setup_grammar.py python | ||||||||||||||||||||||||||||
| - name: Build package | ||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||
| python -m pip install build twine | ||||||||||||||||||||||||||||
| cd cratedb_sqlparse_py | ||||||||||||||||||||||||||||
| python -m build | ||||||||||||||||||||||||||||
| twine check dist/{*.tar.gz,*.whl} | ||||||||||||||||||||||||||||
|
Comment on lines
+25
to
+28
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you like it, a variant of those incantations could be: cd cratedb_sqlparse_py
python -m pip install '.[release]'
poe releasecratedb-sqlparse/cratedb_sqlparse_py/pyproject.toml Lines 87 to 90 in 6542f48
cratedb-sqlparse/cratedb_sqlparse_py/pyproject.toml Lines 221 to 224 in 6542f48
In this spirit, CI and manual procedures will be synchronized, through the canonical Lines 109 to 113 in 6542f48
|
||||||||||||||||||||||||||||
| - name: Publish package to PyPI | ||||||||||||||||||||||||||||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||
| packages-dir: cratedb_sqlparse_py/dist/ | ||||||||||||||||||||||||||||
| user: __token__ | ||||||||||||||||||||||||||||
| password: ${{ secrets.PYPI_API_TOKEN }} | ||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!