Skip to content

Commit 1d80c6a

Browse files
ci: release pipeline (cutting, publishing) (#62)
* ci: add release and release-please workflows * chore: tag 1.0.1rc5 * chore: fixup * chore: update release-please config, add wait for testpypi package * chore: fixup * Update version to 2.2.2-test * chore: Bump version * chore: Bump version * chore: Bump version * Fix tests * Fix tests * bump version --------- Co-authored-by: Gilbert Montague <[email protected]>
1 parent 7cffd1d commit 1d80c6a

File tree

6 files changed

+129
-22
lines changed

6 files changed

+129
-22
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,8 @@ jobs:
3434
run: |
3535
pytest -v
3636
37-
test-examples:
38-
runs-on: ubuntu-latest
39-
40-
steps:
41-
- name: Checkout code
42-
uses: actions/checkout@v3
43-
with:
44-
submodules: recursive
45-
token: ${{ secrets.GH_TOKEN }}
46-
47-
- name: Set up Python
48-
uses: actions/setup-python@v4
49-
with:
50-
python-version: "3.12"
51-
52-
- name: Install dependencies
37+
- name: Run examples
5338
run: |
54-
python -m pip install --upgrade pip
55-
pip install -r requirements.txt
56-
make
57-
pip install -e .
58-
5939
synapse-sim --iface-ip 127.0.0.1 --rpc-port 50051 &
6040
6141
sleep 5
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
name: release-please
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.RELEASE_PLEASE_AT }}

.github/workflows/release.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: main
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
id-token: write
10+
11+
jobs:
12+
sdist:
13+
name: Build source distribution
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: "recursive"
20+
- uses: actions/setup-python@v5
21+
- name: Prep repo
22+
run: |
23+
pip install -r requirements.txt
24+
make
25+
- name: Build sdist
26+
run: python -m build --sdist
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: sdist
30+
path: dist/*.tar.gz
31+
32+
publish-testpypi:
33+
name: Publish to testpypi
34+
needs: [sdist]
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: testpypi
38+
url: https://test.pypi.org/legacy/
39+
permissions:
40+
id-token: write
41+
steps:
42+
- uses: actions/download-artifact@v4
43+
with:
44+
name: sdist
45+
path: dist
46+
47+
- name: List files
48+
run: ls -la dist/
49+
50+
- name: Publish package distributions to testpypi
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
with:
53+
repository-url: https://test.pypi.org/legacy/
54+
verbose: true
55+
56+
validate-test-pypi-release:
57+
runs-on: ubuntu-latest
58+
needs: publish-testpypi
59+
steps:
60+
- name: wait for package to be available
61+
run: sleep 30
62+
63+
- name: install test pypi release
64+
run: |
65+
# Get version from GitHub ref (removes 'refs/tags/v' prefix)
66+
VERSION=${GITHUB_REF_NAME#v}
67+
pip install --extra-index-url https://test.pypi.org/simple/ science-synapse==$VERSION
68+
69+
- name: validate
70+
run: |
71+
# Run Help
72+
synapsectl --help
73+
74+
# Run Simulator
75+
synapse-sim --iface-ip 127.0.0.1 --rpc-port 50051 &
76+
sleep 2
77+
78+
synapsectl -u 127.0.0.1:50051 info
79+
80+
# Kill Simulator
81+
kill $(jobs -p)
82+
83+
publish-pypi:
84+
name: Publish to pypi
85+
needs: [validate-test-pypi-release]
86+
runs-on: ubuntu-latest
87+
environment:
88+
name: pypi
89+
url: https://pypi.org/p/science-synapse/
90+
permissions:
91+
id-token: write
92+
steps:
93+
- uses: actions/download-artifact@v4
94+
with:
95+
name: sdist
96+
path: dist
97+
98+
- name: Publish package distributions to pypi
99+
uses: pypa/gh-action-pypi-publish@release/v1
100+
with:
101+
verbose: true

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.0.1"
3+
}

release-please-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"packages": { ".": { "release-type": "python" } },
3+
"bootstrap-sha": "4d93567a0c5c6d48d2a7ce3a69e89fbf6395eb81",
4+
"always-update": true
5+
}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
setup(
2828
name="science-synapse",
29-
version="2.2.1",
29+
version="2.2.4",
3030
description="Client library and CLI for the Synapse API",
3131
author="Science Team",
3232
author_email="[email protected]",

0 commit comments

Comments
 (0)