Skip to content

Commit b595cbb

Browse files
chore: setup releases [skip ci]
1 parent e68cf59 commit b595cbb

17 files changed

+794
-311
lines changed

Diff for: .dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*
22
!/\.nvmrc
3+
!/\.out/
34
!/dev/docker/files/
45
!/rust-toolchain.toml

Diff for: .github/workflows/cli.yml

+75-76
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# Build CLI binaries and publish them to GitHub Releases.
21
name: cli
32

43
on:
54
push:
6-
branches: [ 'rust-ci' ]
5+
branches: [ 'master', 'release', 'rust' ]
76

87
pull_request:
98

@@ -370,77 +369,77 @@ jobs:
370369
git -c color.ui=always diff --exit-code 'docs/docs/reference.md' || (echo "Looks like command-line interface has changed, but the autogenerated CLI reference documentation at 'docs/docs/reference.md' is not up-to-date. Please build the fresh version of pangraph, then run 'cd docs && ./generate-reference-docs <path_to_pangraph> docs/docs/reference.md', then verify and commit changes to the file docs/docs/reference.md." >&2; exit 1)
371370
372371
373-
# publish-to-github-releases:
374-
# name: "Publish to GitHub Releases"
375-
# needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test ]
376-
# if: endsWith(github.ref, '/release-cli')
377-
# runs-on: ubuntu-24.04
378-
#
379-
# steps:
380-
# - name: "Checkout code"
381-
# uses: actions/checkout@v4
382-
# with:
383-
# fetch-depth: 1
384-
# submodules: true
385-
#
386-
# - name: "Download build artifacts"
387-
# uses: actions/download-artifact@v4
388-
# with:
389-
# pattern: pangraph-*
390-
# merge-multiple: true
391-
# path: ".out"
392-
#
393-
# - name: "Install deploy dependencies"
394-
# run: |
395-
# mkdir -p "${HOME}/bin"
396-
# curl -fsSL "https://github.com/cli/cli/releases/download/v2.10.1/gh_2.10.1_linux_amd64.tar.gz" | tar xz -C "${HOME}/bin" --strip-components=2 gh_2.10.1_linux_amd64/bin/gh
397-
# curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel"
398-
# curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v0.7.0/git-cliff-0.7.0-x86_64-unknown-linux-gnu.tar.gz" | tar -C "${HOME}/bin" --strip-components=1 -xz "git-cliff-0.7.0/git-cliff"
399-
# curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" -o ${HOME}/bin/jq && chmod +x ${HOME}/bin/jq
400-
#
401-
# - name: "Publish build artifacts to GitHub releases"
402-
# run: |
403-
# export PATH="${PATH}:${HOME}/bin"
404-
# export GITHUB_TOKEN="${{ secrets.NEHERLAB_BOT_GITHUB_TOKEN }}"
405-
# ./scripts/publish_github \
406-
# --artifacts_dir ".out" \
407-
# --repo "${{ github.repository }}" \
408-
# --git_sha "${{ github.sha }}"
409-
410-
# publish-to-docker-hub:
411-
# name: "Publish to Docker Hub"
412-
# needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test ]
413-
# if: endsWith(github.ref, '/release-cli')
414-
# runs-on: ubuntu-24.04
415-
#
416-
# steps:
417-
# - name: "Checkout code"
418-
# uses: actions/checkout@v4
419-
# with:
420-
# fetch-depth: 1
421-
# submodules: true
422-
#
423-
# - name: "Download build artifacts"
424-
# uses: actions/download-artifact@v4
425-
# with:
426-
# pattern: pangraph-*
427-
# merge-multiple: true
428-
# path: ".out"
429-
#
430-
# - name: "Install deploy dependencies"
431-
# run: |
432-
# mkdir -p "${HOME}/bin"
433-
# curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel"
434-
#
435-
# - name: "Login to Docker Hub"
436-
# uses: docker/login-action@v3
437-
# with:
438-
# registry: docker.io
439-
# username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }}
440-
# password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }}
441-
#
442-
# - name: "Build and publish Docker container images to Docker Hub"
443-
# run: |
444-
# export PATH="${PATH}:${HOME}/bin"
445-
# chmod +x ./.out/*
446-
# ./scripts/publish_docker --push
372+
publish-to-github-releases:
373+
name: "Publish to GitHub Releases"
374+
needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test, check-cli-docs ]
375+
if: endsWith(github.ref, '/release-cli')
376+
runs-on: ubuntu-24.04
377+
378+
steps:
379+
- name: "Checkout code"
380+
uses: actions/checkout@v4
381+
with:
382+
fetch-depth: 1
383+
submodules: true
384+
385+
- name: "Download build artifacts"
386+
uses: actions/download-artifact@v4
387+
with:
388+
pattern: pangraph-*
389+
merge-multiple: true
390+
path: ".out"
391+
392+
- name: "Install deploy dependencies"
393+
run: |
394+
mkdir -p "${HOME}/bin"
395+
curl -fsSL "https://github.com/cli/cli/releases/download/v2.10.1/gh_2.10.1_linux_amd64.tar.gz" | tar xz -C "${HOME}/bin" --strip-components=2 gh_2.10.1_linux_amd64/bin/gh
396+
curl -fsSL "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel"
397+
curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-1.7.1/jq-linux64" -o ${HOME}/bin/jq && chmod +x ${HOME}/bin/jq
398+
399+
- name: "Publish build artifacts to GitHub releases"
400+
run: |
401+
export PATH="${PATH}:${HOME}/bin"
402+
export GITHUB_TOKEN="${{ secrets.NEHERLAB_BOT_GITHUB_TOKEN }}"
403+
./dev/publish-github \
404+
--artifacts_dir ".out" \
405+
--repo "${{ github.repository }}" \
406+
--git_sha "${{ github.sha }}"
407+
408+
409+
publish-to-docker-hub:
410+
name: "Publish to Docker Hub"
411+
needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test, check-cli-docs ]
412+
if: endsWith(github.ref, '/release-cli')
413+
runs-on: ubuntu-24.04
414+
415+
steps:
416+
- name: "Checkout code"
417+
uses: actions/checkout@v4
418+
with:
419+
fetch-depth: 1
420+
submodules: true
421+
422+
- name: "Download build artifacts"
423+
uses: actions/download-artifact@v4
424+
with:
425+
pattern: pangraph-*
426+
merge-multiple: true
427+
path: ".out"
428+
429+
- name: "Install deploy dependencies"
430+
run: |
431+
mkdir -p "${HOME}/bin"
432+
curl -fsSL "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel"
433+
434+
- name: "Login to Docker Hub"
435+
uses: docker/login-action@v3
436+
with:
437+
registry: docker.io
438+
username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }}
439+
password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }}
440+
441+
- name: "Build and publish Docker container images to Docker Hub"
442+
run: |
443+
export PATH="${PATH}:${HOME}/bin"
444+
chmod +x ./.out/*
445+
./dev/publish-docker --push

Diff for: .github/workflows/docs.yml

+10
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,13 @@ jobs:
6161
run: |
6262
cd docs/
6363
./deploy
64+
65+
- name: "Create git tag"
66+
run: |
67+
git config --global user.name "${{ secrets.NEHERLAB_BOT_GITHUB_NAME }}"
68+
git config --global user.email "${{ secrets.NEHERLAB_BOT_GITHUB_EMAIL }}"
69+
70+
version=$(date --utc +%Y-%m-%d_%H-%M-%SZ)
71+
72+
git tag "docs-${version}"
73+
git push origin "docs-${version}"

Diff for: .github/workflows/pypangraph.yml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: pypangraph
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'release-pypangraph' ]
6+
paths:
7+
- packages/pypangraph/**
8+
9+
pull_request:
10+
paths:
11+
- packages/pypangraph/**
12+
13+
repository_dispatch:
14+
types: build
15+
16+
workflow_dispatch:
17+
18+
workflow_call:
19+
20+
concurrency:
21+
group: pypangraph-${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
22+
cancel-in-progress: true
23+
24+
defaults:
25+
run:
26+
shell: bash -euo pipefail {0}
27+
28+
env:
29+
GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
30+
31+
32+
jobs:
33+
build:
34+
name: "Build PyPangraph (${{ matrix.python-version }})"
35+
runs-on: ubuntu-24.04
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
40+
41+
steps:
42+
- name: "Checkout code"
43+
- uses: actions/checkout@v4
44+
45+
- name: "Set up Python ${{ matrix.python-version }}"
46+
uses: actions/setup-python@v3
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
50+
- name: "Install dependencies"
51+
run: |
52+
python -m pip install --upgrade pip
53+
python -m pip install flake8 pytest
54+
python -m pip install .
55+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
56+
57+
- name: "Lint"
58+
run: |
59+
# stop the build if there are Python syntax errors or undefined names
60+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
61+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
62+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
63+
64+
- name: "Test"
65+
run: |
66+
pytest
67+
68+
publish-to-pypi:
69+
name: "Publish to PyPI"
70+
needs: [ build ]
71+
if: endsWith(github.ref, '/release-pypangraph')
72+
runs-on: ubuntu-24.04
73+
74+
steps:
75+
- name: "Checkout code"
76+
- uses: actions/checkout@v4
77+
78+
- name: "Setup Python"
79+
uses: actions/setup-python@v3
80+
with:
81+
python-version: '3.x'
82+
83+
- name: "Install dependencies"
84+
run: |
85+
python -m pip install --upgrade pip
86+
pip install build
87+
88+
- name: "Build package"
89+
run: python -m build
90+
91+
- name: "Publish package"
92+
uses: pypa/gh-action-pypi-publish@release/v1
93+
with:
94+
user: __token__
95+
password: ${{ secrets.NEHERLAB_BOT_PYPI_TOKEN }}
96+
97+
- name: "Create git tag"
98+
run: |
99+
git config --global user.name "${{ secrets.NEHERLAB_BOT_GITHUB_NAME }}"
100+
git config --global user.email "${{ secrets.NEHERLAB_BOT_GITHUB_EMAIL }}"
101+
102+
version=$(dasel select -r toml -w - -s ".package.version" -f "packages/pypangraph/pyproject.toml")
103+
104+
git tag "pypangraph-${version}"
105+
git push origin "pypangraph-${version}"

Diff for: dev/docker/files/install-dasel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euxo pipefail
33

4-
curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.22.1/dasel_linux_amd64" -o "/usr/bin/dasel"
4+
curl -fsSL "https://github.com/TomWright/dasel/releases/download/v2.8.1/dasel_linux_amd64" -o "/usr/bin/dasel"
55
chmod +x "/usr/bin/dasel"
66
which dasel
77
dasel --version

Diff for: dev/docker/files/install-jq

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -euxo pipefail
33

4-
curl -fsSL -o "/usr/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64"
4+
curl -fsSL -o "/usr/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-1.7.1/jq-linux64"
55
chmod +x "/usr/bin/jq"
66
which jq
77
jq --version

Diff for: dev/docker/prod-debian.dockerfile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# syntax=docker/dockerfile:1
2+
# check=experimental=all
3+
FROM debian:12
4+
5+
SHELL ["bash", "-euxo", "pipefail", "-c"]
6+
7+
8+
RUN set -euxo pipefail \
9+
&& ln -s /usr/bin/pangraph /pangraph \
10+
&& export DEBIAN_FRONTEND=noninteractive \
11+
&& apt-get update -qq --yes \
12+
&& apt-get install -qq --no-install-recommends --yes \
13+
bash \
14+
ca-certificates \
15+
curl \
16+
tar \
17+
>/dev/null \
18+
&& apt-get autoremove --yes >/dev/null \
19+
&& apt-get clean autoclean >/dev/null \
20+
&& rm -rf /var/lib/apt/lists/*
21+
22+
23+
RUN set -euxo pipefail \
24+
&& export MMSEQS_VERSION="17-b804f" \
25+
&& curl -fsSL "https://github.com/soedinglab/MMseqs2/releases/download/${MMSEQS_VERSION}/mmseqs-linux-sse41.tar.gz" \
26+
| tar --strip-components=2 -C "/usr/bin" -xz "mmseqs/bin/mmseqs" \
27+
&& ls "/usr/bin/mmseqs" \
28+
&& /usr/bin/mmseqs --help \
29+
&& mmseqs --help
30+
31+
32+
COPY .out/pangraph-x86_64-unknown-linux-gnu /usr/bin/pangraph
33+
RUN set -euxo pipefail \
34+
&& ls "/usr/bin/pangraph" \
35+
&& /usr/bin/pangraph --help \
36+
&& pangraph --help \

Diff for: dev/extract-release-notes

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import sys
5+
6+
7+
def find_release_notes(input_changelog_md: str):
8+
release_notes = ""
9+
found_release_notes_block = False
10+
with open(input_changelog_md) as f:
11+
for line in f:
12+
if not found_release_notes_block and line.startswith("## "):
13+
found_release_notes_block = True
14+
release_notes += line
15+
elif found_release_notes_block:
16+
if line.startswith("## "):
17+
return release_notes
18+
else:
19+
release_notes += line
20+
21+
22+
if __name__ == '__main__':
23+
parser = argparse.ArgumentParser(description='Extracts last release notes section from a changelog markdown file')
24+
parser.add_argument('input_changelog_md', type=str, help='Input changelog file in markdown format')
25+
args = parser.parse_args()
26+
27+
release_notes = find_release_notes(args.input_changelog_md)
28+
29+
sys.stdout.write(release_notes)

0 commit comments

Comments
 (0)