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(templates): Added an optional GitHub workflow to publish to PyPI with trusted publishers #2426

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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repos:
cookiecutter/.*/meltano.yml|
cookiecutter/.*/.pre-commit-config.yaml|
cookiecutter/.*/dependabot.yml|
cookiecutter/.*/build.yml|
cookiecutter/.*/test.yml
)$
- id: end-of-file-fixer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:

permissions:
contents: write # Needed to upload artifacts to the release
id-token: write # Needed for OIDC PyPI publishing

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
## TODO: optionally provide the name of the environment for the trusted
## publisher on PyPI
## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
# environment: pypi
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: {{ '${{secrets.GITHUB_TOKEN}}' }}
file: dist/*.whl
tag: {{ '${{github.ref}}' }}
overwrite: true
file_glob: true

- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:

permissions:
contents: write # Needed to upload artifacts to the release
id-token: write # Needed for OIDC PyPI publishing

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
## TODO: optionally provide the name of the environment for the trusted
## publisher on PyPI
## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
# environment: pypi
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: {{ '${{secrets.GITHUB_TOKEN}}' }}
file: dist/*.whl
tag: {{ '${{github.ref}}' }}
overwrite: true
file_glob: true

- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:

permissions:
contents: write # Needed to upload artifacts to the release
id-token: write # Needed for OIDC PyPI publishing

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build]
## TODO: optionally provide the name of the environment for the trusted
## publisher on PyPI
## https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
# environment: pypi
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Upload wheel to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: {{ '${{secrets.GITHUB_TOKEN}}' }}
file: dist/*.whl
tag: {{ '${{github.ref}}' }}
overwrite: true
file_glob: true

- name: Publish
## TODO: create a trusted publisher on PyPI
## https://docs.pypi.org/trusted-publishers/
uses: pypa/[email protected]
2 changes: 1 addition & 1 deletion samples/sample_tap_gitlab/schemas/epic_issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"type": "string"
},
"discussion_locked": {
"type": "null"
"type": ["boolean", "null"]
},
"downvotes": {
"type": "integer"
Expand Down
Loading