-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'chore/setup-releases' into rust
- Loading branch information
Showing
17 changed files
with
794 additions
and
311 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
* | ||
!/\.nvmrc | ||
!/\.out/ | ||
!/dev/docker/files/ | ||
!/rust-toolchain.toml |
This file contains 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
This file contains 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
This file contains 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,105 @@ | ||
name: pypangraph | ||
|
||
on: | ||
push: | ||
branches: [ 'master', 'release-pypangraph' ] | ||
paths: | ||
- packages/pypangraph/** | ||
|
||
pull_request: | ||
paths: | ||
- packages/pypangraph/** | ||
|
||
repository_dispatch: | ||
types: build | ||
|
||
workflow_dispatch: | ||
|
||
workflow_call: | ||
|
||
concurrency: | ||
group: pypangraph-${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash -euo pipefail {0} | ||
|
||
env: | ||
GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} | ||
|
||
|
||
jobs: | ||
build: | ||
name: "Build PyPangraph (${{ matrix.python-version }})" | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | ||
|
||
steps: | ||
- name: "Checkout code" | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "Set up Python ${{ matrix.python-version }}" | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install flake8 pytest | ||
python -m pip install . | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: "Lint" | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: "Test" | ||
run: | | ||
pytest | ||
publish-to-pypi: | ||
name: "Publish to PyPI" | ||
needs: [ build ] | ||
if: endsWith(github.ref, '/release-pypangraph') | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: "Checkout code" | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "Setup Python" | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: "Install dependencies" | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: "Build package" | ||
run: python -m build | ||
|
||
- name: "Publish package" | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.NEHERLAB_BOT_PYPI_TOKEN }} | ||
|
||
- name: "Create git tag" | ||
run: | | ||
git config --global user.name "${{ secrets.NEHERLAB_BOT_GITHUB_NAME }}" | ||
git config --global user.email "${{ secrets.NEHERLAB_BOT_GITHUB_EMAIL }}" | ||
version=$(dasel select -r toml -w - -s ".package.version" -f "packages/pypangraph/pyproject.toml") | ||
git tag "pypangraph-${version}" | ||
git push origin "pypangraph-${version}" |
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.22.1/dasel_linux_amd64" -o "/usr/bin/dasel" | ||
curl -fsSL "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_amd64" -o "/usr/bin/dasel" | ||
chmod +x "/usr/bin/dasel" | ||
which dasel | ||
dasel --version |
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
curl -fsSL -o "/usr/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" | ||
curl -fsSL -o "/usr/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-1.7.1/jq-linux64" | ||
chmod +x "/usr/bin/jq" | ||
which jq | ||
jq --version |
This file contains 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,36 @@ | ||
# syntax=docker/dockerfile:1 | ||
# check=experimental=all | ||
FROM debian:12 | ||
|
||
SHELL ["bash", "-euxo", "pipefail", "-c"] | ||
|
||
|
||
RUN set -euxo pipefail \ | ||
&& ln -s /usr/bin/pangraph /pangraph \ | ||
&& export DEBIAN_FRONTEND=noninteractive \ | ||
&& apt-get update -qq --yes \ | ||
&& apt-get install -qq --no-install-recommends --yes \ | ||
bash \ | ||
ca-certificates \ | ||
curl \ | ||
tar \ | ||
>/dev/null \ | ||
&& apt-get autoremove --yes >/dev/null \ | ||
&& apt-get clean autoclean >/dev/null \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
RUN set -euxo pipefail \ | ||
&& export MMSEQS_VERSION="17-b804f" \ | ||
&& curl -fsSL "https://github.com/soedinglab/MMseqs2/releases/download/${MMSEQS_VERSION}/mmseqs-linux-sse41.tar.gz" \ | ||
| tar --strip-components=2 -C "/usr/bin" -xz "mmseqs/bin/mmseqs" \ | ||
&& ls "/usr/bin/mmseqs" \ | ||
&& /usr/bin/mmseqs --help \ | ||
&& mmseqs --help | ||
|
||
|
||
COPY .out/pangraph-x86_64-unknown-linux-gnu /usr/bin/pangraph | ||
RUN set -euxo pipefail \ | ||
&& ls "/usr/bin/pangraph" \ | ||
&& /usr/bin/pangraph --help \ | ||
&& pangraph --help \ |
This file contains 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,29 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import sys | ||
|
||
|
||
def find_release_notes(input_changelog_md: str): | ||
release_notes = "" | ||
found_release_notes_block = False | ||
with open(input_changelog_md) as f: | ||
for line in f: | ||
if not found_release_notes_block and line.startswith("## "): | ||
found_release_notes_block = True | ||
release_notes += line | ||
elif found_release_notes_block: | ||
if line.startswith("## "): | ||
return release_notes | ||
else: | ||
release_notes += line | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser(description='Extracts last release notes section from a changelog markdown file') | ||
parser.add_argument('input_changelog_md', type=str, help='Input changelog file in markdown format') | ||
args = parser.parse_args() | ||
|
||
release_notes = find_release_notes(args.input_changelog_md) | ||
|
||
sys.stdout.write(release_notes) |
Oops, something went wrong.