-
Notifications
You must be signed in to change notification settings - Fork 1
INTPYTHON-615 Set up GitHub workflows for automated releases #7
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
76db892
INTPYTHON-615 Set up GitHub workflows for automated releases
blink1073 3b1177b
add files
blink1073 abf05b3
cleanup and add gitignore
blink1073 0ae769f
address automated review
blink1073 464808a
add zizmor config
blink1073 756f584
address automated review
blink1073 d948a3f
bump to alpha version
blink1073 210e3e4
address review
blink1073 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "master", "*" ] | ||
pull_request: | ||
branches: [ "master", "*" ] | ||
schedule: | ||
- cron: '35 23 * * 5' | ||
workflow_call: | ||
inputs: | ||
ref: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze ${{ matrix.language }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 360 | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
# required to fetch internal or private CodeQL packs | ||
packages: read | ||
actions: read | ||
contents: read | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- language: python | ||
- language: actions | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
persist-credentials: false | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
build-mode: none | ||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
queries: security-extended | ||
config: | | ||
paths-ignore: | ||
- 'test/**' | ||
|
||
- shell: bash | ||
if: matrix.language == 'python' | ||
run: | | ||
pip install -e . | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3 | ||
with: | ||
category: "/language:${{ matrix.language }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Python Dist | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+.post[0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+[a-b][0-9]+" | ||
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+" | ||
workflow_dispatch: | ||
pull_request: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
|
||
concurrency: | ||
group: dist-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash -eux {0} | ||
|
||
jobs: | ||
make_dist: | ||
name: Make Dist | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
# Build sdist on lowest supported Python | ||
python-version: '3.10' | ||
|
||
- name: Install python requirements | ||
run: | | ||
python -m pip install uv rust-just build | ||
|
||
- name: Build Dist | ||
run: | | ||
python -m build . | ||
|
||
- name: Test SDist | ||
run: | | ||
python -m pip install dist/*.gz | ||
cd .. | ||
python -c "from pymongo_voyageai import PyMongoVoyageAI" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: "dist" | ||
path: ./dist/*.* | ||
|
||
|
||
collect_dist: | ||
|
||
runs-on: ubuntu-latest | ||
needs: [make_dist] | ||
name: Download Dist | ||
steps: | ||
- name: Download all workflow run artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Flatten directory | ||
working-directory: . | ||
run: | | ||
find . -mindepth 2 -type f -exec mv {} . \; | ||
find . -type d -empty -delete | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: all-dist-${{ github.run_id }} | ||
path: "./*" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
main not master
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.
fixed