Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit c5bdd1e

Browse files
committed
Merge tag 'v1.68.0' into beeper
Synapse 1.68.0 (2022-09-27) =========================== Please note that Synapse will now refuse to start if configured to use a version of SQLite older than 3.27. In addition, please note that installing Synapse from a source checkout now requires a recent Rust compiler. Those using packages will not be affected. On most platforms, installing with `pip install matrix-synapse` will not be affected. See the [upgrade notes](https://matrix-org.github.io/synapse/v1.68/upgrade.html#upgrading-to-v1680). Bugfixes -------- - Fix packaging to include `Cargo.lock` in `sdist`. ([\matrix-org#13909](matrix-org#13909)) Synapse 1.68.0rc2 (2022-09-23) ============================== Bugfixes -------- - Fix building from packaged sdist. Broken in v1.68.0rc1. ([\matrix-org#13866](matrix-org#13866)) Internal Changes ---------------- - Fix the release script not publishing binary wheels. ([\matrix-org#13850](matrix-org#13850)) - Lower minimum supported rustc version to 1.58.1. ([\matrix-org#13857](matrix-org#13857)) - Lock Rust dependencies' versions. ([\matrix-org#13858](matrix-org#13858)) Synapse 1.68.0rc1 (2022-09-20) ============================== Features -------- - Keep track of when we fail to process a pulled event over federation so we can intelligently back off in the future. ([\matrix-org#13589](matrix-org#13589), [\matrix-org#13814](matrix-org#13814)) - Add an [admin API endpoint to fetch messages within a particular window of time](https://matrix-org.github.io/synapse/v1.68/admin_api/rooms.html#room-messages-api). ([\matrix-org#13672](matrix-org#13672)) - Add an [admin API endpoint to find a user based on their external ID in an auth provider](https://matrix-org.github.io/synapse/v1.68/admin_api/user_admin_api.html#find-a-user-based-on-their-id-in-an-auth-provider). ([\matrix-org#13810](matrix-org#13810)) - Cancel the processing of key query requests when they time out. ([\matrix-org#13680](matrix-org#13680)) - Improve validation of request bodies for the following client-server API endpoints: [`/account/3pid/msisdn/requestToken`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3account3pidmsisdnrequesttoken), [`/org.matrix.msc3720/account_status`](https://github.com/matrix-org/matrix-spec-proposals/blob/babolivier/user_status/proposals/3720-account-status.md#post-_matrixclientv1account_status), [`/account/3pid/add`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3account3pidadd), [`/account/3pid/bind`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3account3pidbind), [`/account/3pid/delete`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3account3piddelete) and [`/account/3pid/unbind`](https://spec.matrix.org/v1.3/client-server-api/#post_matrixclientv3account3pidunbind). ([\matrix-org#13687](matrix-org#13687), [\matrix-org#13736](matrix-org#13736)) - Document the timestamp when a user accepts the consent, if [consent tracking](https://matrix-org.github.io/synapse/latest/consent_tracking.html) is used. ([\matrix-org#13741](matrix-org#13741)) - Add a `listeners[x].request_id_header` configuration option to specify which request header to extract and use as the request ID in order to correlate requests from a reverse proxy. ([\matrix-org#13801](matrix-org#13801)) Bugfixes -------- - Fix a bug introduced in Synapse 1.41.0 where the `/hierarchy` API returned non-standard information (a `room_id` field under each entry in `children_state`). ([\matrix-org#13506](matrix-org#13506)) - Fix a long-standing bug where previously rejected events could end up in room state because they pass auth checks given the current state of the room. ([\matrix-org#13723](matrix-org#13723)) - Fix a long-standing bug where Synapse fails to start if a signing key file contains an empty line. ([\matrix-org#13738](matrix-org#13738)) - Fix a long-standing bug where Synapse would fail to handle malformed user IDs or room aliases gracefully in certain cases. ([\matrix-org#13746](matrix-org#13746)) - Fix a long-standing bug where device lists would remain cached when remote users left and rejoined the last room shared with the local homeserver. ([\matrix-org#13749](matrix-org#13749), [\matrix-org#13826](matrix-org#13826)) - Fix a long-standing bug that could cause stale caches in some rare cases on the first startup of Synapse with replication. ([\matrix-org#13766](matrix-org#13766)) - Fix a long-standing spec compliance bug where Synapse would accept a trailing slash on the end of `/get_missing_events` federation requests. ([\matrix-org#13789](matrix-org#13789)) - Delete associated data from `event_failed_pull_attempts`, `insertion_events`, `insertion_event_extremities`, `insertion_event_extremities`, `insertion_event_extremities` when purging the room. ([\matrix-org#13825](matrix-org#13825)) Improved Documentation ---------------------- - Note that `libpq` is required on ARM-based Macs. ([\matrix-org#13480](matrix-org#13480)) - Fix a mistake in the config manual introduced in Synapse 1.22.0: the `event_cache_size` _is_ scaled by `caches.global_factor`. ([\matrix-org#13726](matrix-org#13726)) - Fix a typo in the documentation for the login ratelimiting configuration. ([\matrix-org#13727](matrix-org#13727)) - Define Synapse's compatability policy for SQLite versions. ([\matrix-org#13728](matrix-org#13728)) - Add docs for the common fix of deleting the `matrix_synapse.egg-info/` directory for fixing Python dependency problems. ([\matrix-org#13785](matrix-org#13785)) - Update request log format documentation to mention the format used when the authenticated user is controlling another user. ([\matrix-org#13794](matrix-org#13794)) Deprecations and Removals ------------------------- - Synapse will now refuse to start if configured to use SQLite < 3.27. ([\matrix-org#13760](matrix-org#13760)) - Don't include redundant `prev_state` in new events. Contributed by Denis Kariakin (@dakariakin). ([\matrix-org#13791](matrix-org#13791)) Internal Changes ---------------- - Add a stub Rust crate. ([\matrix-org#12595](matrix-org#12595), [\matrix-org#13734](matrix-org#13734), [\matrix-org#13735](matrix-org#13735), [\matrix-org#13743](matrix-org#13743), [\matrix-org#13763](matrix-org#13763), [\matrix-org#13769](matrix-org#13769), [\matrix-org#13778](matrix-org#13778)) - Bump the minimum dependency of `matrix_common` to 1.3.0 to make use of the `MXCUri` class. Use `MXCUri` to simplify media retention test code. ([\matrix-org#13162](matrix-org#13162)) - Add and populate the `event_stream_ordering` column on the `receipts` table for future optimisation of push action processing. Contributed by Nick @ Beeper (@Fizzadar). ([\matrix-org#13703](matrix-org#13703)) - Rename the `EventFormatVersions` enum values so that they line up with room version numbers. ([\matrix-org#13706](matrix-org#13706)) - Update trial old deps CI to use Poetry 1.2.0. ([\matrix-org#13707](matrix-org#13707), [\matrix-org#13725](matrix-org#13725)) - Add experimental configuration option to allow disabling legacy Prometheus metric names. ([\matrix-org#13714](matrix-org#13714), [\matrix-org#13717](matrix-org#13717), [\matrix-org#13718](matrix-org#13718)) - Fix typechecking with latest types-jsonschema. ([\matrix-org#13724](matrix-org#13724)) - Strip number suffix from instance name to consolidate services that traces are spread over. ([\matrix-org#13729](matrix-org#13729)) - Instrument `get_metadata_for_events` for understandable traces in Jaeger. ([\matrix-org#13730](matrix-org#13730)) - Remove old queries to join room memberships to current state events. Contributed by Nick @ Beeper (@Fizzadar). ([\matrix-org#13745](matrix-org#13745)) - Avoid raising an error due to malformed user IDs in `get_current_hosts_in_room`. Malformed user IDs cannot currently join a room, so this error would not be hit. ([\matrix-org#13748](matrix-org#13748)) - Update the docstrings for `get_users_in_room` and `get_current_hosts_in_room` to explain the impact of partial state. ([\matrix-org#13750](matrix-org#13750)) - Use an additional database query when persisting receipts. ([\matrix-org#13752](matrix-org#13752)) - Preparatory work for storing thread IDs for notifications and receipts. ([\matrix-org#13753](matrix-org#13753)) - Re-type hint some collections as read-only. ([\matrix-org#13754](matrix-org#13754)) - Remove unused Prometheus recording rules from `synapse-v2.rules` and add comments describing where the rest are used. ([\matrix-org#13756](matrix-org#13756)) - Add a check for editable installs if the Rust library needs rebuilding. ([\matrix-org#13759](matrix-org#13759)) - Tag traces with the instance name to be able to easily jump into the right logs and filter traces by instance. ([\matrix-org#13761](matrix-org#13761)) - Concurrently fetch room push actions when calculating badge counts. Contributed by Nick @ Beeper (@Fizzadar). ([\matrix-org#13765](matrix-org#13765)) - Update the script which makes full schema dumps. ([\matrix-org#13770](matrix-org#13770)) - Deduplicate `is_server_notices_room`. ([\matrix-org#13780](matrix-org#13780)) - Simplify the dependency DAG in the tests workflow. ([\matrix-org#13784](matrix-org#13784)) - Remove an old, incorrect migration file. ([\matrix-org#13788](matrix-org#13788)) - Remove unused method in `synapse.api.auth.Auth`. ([\matrix-org#13795](matrix-org#13795)) - Fix a memory leak when running the unit tests. ([\matrix-org#13798](matrix-org#13798)) - Use partial indices on SQLite. ([\matrix-org#13802](matrix-org#13802)) - Check that portdb generates the same postgres schema as that in the source tree. ([\matrix-org#13808](matrix-org#13808)) - Fix Docker build when Rust .so has been built locally first. ([\matrix-org#13811](matrix-org#13811)) - Complement: Initialise the Postgres database directly inside the target image instead of the base Postgres image to fix building using Buildah. ([\matrix-org#13819](matrix-org#13819)) - Support providing an index predicate clause when doing upserts. ([\matrix-org#13822](matrix-org#13822)) - Minor speedups to linting in CI. ([\matrix-org#13827](matrix-org#13827)) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE1508oLYUKainYFJakD7OEIo53t0FAmMy4FoACgkQkD7OEIo5 # 3t009g/6A4S26H6NG4GM44JD9+OB25fO59m9UAWWLrePmOKsBaGXVp86scPq9epI # vQbr4Czi8WEqCJlMRxIWLXv7BL3TLXnLF1vC0wSE6YiJqrPU9vMZ0UYxWNErl8Sr # eFBpuHXDlfppQUXs903iNmXVbdTpXCVjdTEwaZmgU1/FKydgU0o90PQseb/hnegX # hcJrepL6xhcs37fP2zdlixissLQ85WE10x6h7FX+SkCEHGvkiKrqSvXsS4ZN0Scn # vGCy3GD69j/ZpRu7RczdDwwzCRerg6r7spokRK/b6pzz9sXmCyY8SrrUyEEdzveN # uEEe4A8vmR3v0sR4Ao2cGZ7zy/jq6WyrWjmfOd+hfYD9tXx/g8190RFkRQrrkYVU # jTNdD6Zom0rtENEgHuFQ8joD96MNsaq4dvDefYYpcXDOh3YZnA/fiwfmG9XZRq6u # B42RZEtUZ3sjZ3VdRb3AvhPTTrY4kiwEqVBFSUTBKEAKXQtdrsiqv2QPvQTSC5BJ # YFXMwj32E7Zi3mTYjl60yggtBAxYt49KsHL8qAq75t6A38HpnYEyEW1R3S6VDmtp # rIR5ktxyzoGvxpJ4YPUdC4A2hbaOztwPvGE3iEDiPgUdkfb6m8x3MhaWhShid4Df # v2BQu+SFIl1wXPLxjlX2rmkQMhUGD2RGYmkUgYfoWnjdTtQV10w= # =4eYj # -----END PGP SIGNATURE----- # gpg: Signature made Tue Sep 27 12:36:58 2022 BST # gpg: using RSA key D79D3CA0B61429A8A760525A903ECE108A39DEDD # gpg: Can't check signature: No public key # Conflicts: # docker/Dockerfile # poetry.lock # synapse/push/bulk_push_rule_evaluator.py # synapse/push/push_tools.py # synapse/storage/databases/main/event_push_actions.py # synapse/storage/databases/main/events_worker.py # tests/replication/slave/storage/test_events.py
2 parents 35d0062 + 3853011 commit c5bdd1e

File tree

139 files changed

+4088
-1093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+4088
-1093
lines changed

.ci/scripts/postgres_exec.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

.ci/scripts/test_old_deps.sh renamed to .ci/scripts/prepare_old_deps.sh

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,8 @@
55
# - creates a venv with these old versions using poetry; and finally
66
# - invokes `trial` to run the tests with old deps.
77

8-
# Prevent tzdata from asking for user input
9-
export DEBIAN_FRONTEND=noninteractive
10-
118
set -ex
129

13-
apt-get update
14-
apt-get install -y \
15-
python3 python3-dev python3-pip python3-venv pipx \
16-
libxml2-dev libxslt-dev xmlsec1 zlib1g-dev libjpeg-dev libwebp-dev
17-
18-
export LANG="C.UTF-8"
19-
2010
# Prevent virtualenv from auto-updating pip to an incompatible version
2111
export VIRTUALENV_NO_DOWNLOAD=1
2212

@@ -33,12 +23,6 @@ export VIRTUALENV_NO_DOWNLOAD=1
3323
# a `cryptography` compiled against OpenSSL 1.1.
3424
# - Omit systemd: we're not logging to journal here.
3525

36-
# TODO: also replace caret bounds, see https://python-poetry.org/docs/dependency-specification/#version-constraints
37-
# We don't use these yet, but IIRC they are the default bound used when you `poetry add`.
38-
# The sed expression 's/\^/==/g' ought to do the trick. But it would also change
39-
# `python = "^3.7"` to `python = "==3.7", which would mean we fail because olddeps
40-
# runs on 3.8 (#12343).
41-
4226
sed -i \
4327
-e "s/[~>]=/==/g" \
4428
-e '/^python = "^/!s/\^/==/g' \
@@ -55,7 +39,7 @@ sed -i \
5539
# toml file. This means we don't have to ensure compatibility between old deps and
5640
# dev tools.
5741

58-
pip install --user toml
42+
pip install toml wheel
5943

6044
REMOVE_DEV_DEPENDENCIES="
6145
import toml
@@ -69,15 +53,12 @@ with open('pyproject.toml', 'w') as f:
6953
"
7054
python3 -c "$REMOVE_DEV_DEPENDENCIES"
7155

72-
pipx install poetry==1.1.14
73-
~/.local/bin/poetry lock
56+
pip install poetry==1.2.0
57+
poetry lock
7458

7559
echo "::group::Patched pyproject.toml"
7660
cat pyproject.toml
7761
echo "::endgroup::"
7862
echo "::group::Lockfile after patch"
7963
cat poetry.lock
8064
echo "::endgroup::"
81-
82-
~/.local/bin/poetry install -E "all test"
83-
~/.local/bin/poetry run trial --jobs=2 tests

.ci/scripts/test_export_data_command.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ else
3232
fi
3333

3434
# Create the PostgreSQL database.
35-
poetry run .ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
35+
psql -c "CREATE DATABASE synapse"
3636

3737
# Port the SQLite databse to postgres so we can check command works against postgres
3838
echo "+++ Port SQLite3 databse to postgres"

.ci/scripts/test_synapse_port_db.sh

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
#
33
# Test script for 'synapse_port_db'.
44
# - configures synapse and a postgres server.
5-
# - runs the port script on a prepopulated test sqlite db
6-
# - also runs it against an new sqlite db
5+
# - runs the port script on a prepopulated test sqlite db. Checks that the
6+
# return code is zero.
7+
# - reruns the port script on the same sqlite db, targetting the same postgres db.
8+
# Checks that the return code is zero.
9+
# - runs the port script against a new sqlite db. Checks the return code is zero.
710
#
811
# Expects Synapse to have been already installed with `poetry install --extras postgres`.
912
# Expects `poetry` to be available on the `PATH`.
1013

11-
set -xe
14+
set -xe -o pipefail
1215
cd "$(dirname "$0")/../.."
1316

1417
echo "--- Generate the signing key"
15-
16-
# Generate the server's signing key.
1718
poetry run synapse_homeserver --generate-keys -c .ci/sqlite-config.yaml
1819

1920
echo "--- Prepare test database"
20-
21-
# Make sure the SQLite3 database is using the latest schema and has no pending background update.
21+
# Make sure the SQLite3 database is using the latest schema and has no pending background updates.
2222
poetry run update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
2323

2424
# Create the PostgreSQL database.
25-
poetry run .ci/scripts/postgres_exec.py "CREATE DATABASE synapse"
25+
psql -c "CREATE DATABASE synapse"
2626

2727
echo "+++ Run synapse_port_db against test database"
2828
# TODO: this invocation of synapse_port_db (and others below) used to be prepended with `coverage run`,
@@ -45,9 +45,23 @@ rm .ci/test_db.db
4545
poetry run update_synapse_database --database-config .ci/sqlite-config.yaml --run-background-updates
4646

4747
# re-create the PostgreSQL database.
48-
poetry run .ci/scripts/postgres_exec.py \
49-
"DROP DATABASE synapse" \
50-
"CREATE DATABASE synapse"
48+
psql \
49+
-c "DROP DATABASE synapse" \
50+
-c "CREATE DATABASE synapse"
5151

5252
echo "+++ Run synapse_port_db against empty database"
5353
poetry run synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
54+
55+
echo "--- Create a brand new postgres database from schema"
56+
cp .ci/postgres-config.yaml .ci/postgres-config-unported.yaml
57+
sed -i -e 's/database: synapse/database: synapse_unported/' .ci/postgres-config-unported.yaml
58+
psql -c "CREATE DATABASE synapse_unported"
59+
poetry run update_synapse_database --database-config .ci/postgres-config-unported.yaml --run-background-updates
60+
61+
echo "+++ Comparing ported schema with unported schema"
62+
# Ignore the tables that portdb creates. (Should it tidy them up when the porting is completed?)
63+
psql synapse -c "DROP TABLE port_from_sqlite3;"
64+
pg_dump --format=plain --schema-only --no-tablespaces --no-acl --no-owner synapse_unported > unported.sql
65+
pg_dump --format=plain --schema-only --no-tablespaces --no-acl --no-owner synapse > ported.sql
66+
# By default, `diff` returns zero if there are no changes and nonzero otherwise
67+
diff -u unported.sql ported.sql | tee schema_diff

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
# things to include
55
!docker
66
!synapse
7+
!rust
78
!README.rst
89
!pyproject.toml
910
!poetry.lock
11+
!Cargo.lock
12+
!build_rust.py
13+
14+
rust/target
15+
synapse/*.so
1016

1117
**/__pycache__

.github/workflows/latest_deps.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# As an overview this workflow:
77
# - checks out develop,
8-
# - installs from source, pulling in the dependencies like a fresh `pip install` would, and
8+
# - installs from source, pulling in the dependencies like a fresh `pip install` would, and
99
# - runs mypy and test suites in that checkout.
1010
#
1111
# Based on the twisted trunk CI job.
@@ -26,12 +26,19 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v2
29+
- name: Install Rust
30+
uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
override: true
34+
- uses: Swatinem/rust-cache@v2
35+
2936
# The dev dependencies aren't exposed in the wheel metadata (at least with current
3037
# poetry-core versions), so we install with poetry.
3138
- uses: matrix-org/setup-python-poetry@v1
3239
with:
3340
python-version: "3.x"
34-
poetry-version: "1.2.0b1"
41+
poetry-version: "1.2.0"
3542
extras: "all"
3643
# Dump installed versions for debugging.
3744
- run: poetry run pip list > before.txt
@@ -53,6 +60,14 @@ jobs:
5360

5461
steps:
5562
- uses: actions/checkout@v2
63+
64+
- name: Install Rust
65+
uses: actions-rs/toolchain@v1
66+
with:
67+
toolchain: stable
68+
override: true
69+
- uses: Swatinem/rust-cache@v2
70+
5671
- run: sudo apt-get -qq install xmlsec1
5772
- name: Set up PostgreSQL ${{ matrix.postgres-version }}
5873
if: ${{ matrix.postgres-version }}
@@ -69,6 +84,12 @@ jobs:
6984
if: ${{ matrix.postgres-version }}
7085
timeout-minutes: 2
7186
run: until pg_isready -h localhost; do sleep 1; done
87+
88+
# We nuke the local copy, as we've installed synapse into the virtualenv
89+
# (rather than use an editable install, which we no longer support). If we
90+
# don't do this then python can't find the native lib.
91+
- run: rm -rf synapse/
92+
7293
- run: python -m twisted.trial --jobs=2 tests
7394
env:
7495
SYNAPSE_POSTGRES: ${{ matrix.database == 'postgres' || '' }}
@@ -113,6 +134,14 @@ jobs:
113134

114135
steps:
115136
- uses: actions/checkout@v2
137+
138+
- name: Install Rust
139+
uses: actions-rs/toolchain@v1
140+
with:
141+
toolchain: stable
142+
override: true
143+
- uses: Swatinem/rust-cache@v2
144+
116145
- name: Ensure sytest runs `pip install`
117146
# Delete the lockfile so sytest will `pip install` rather than `poetry install`
118147
run: rm /src/poetry.lock
@@ -187,4 +216,3 @@ jobs:
187216
with:
188217
update_existing: true
189218
filename: .ci/latest_deps_build_failed_issue_template.md
190-

.github/workflows/release-artifacts.yml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
18-
18+
1919
permissions:
2020
contents: write
2121

@@ -89,16 +89,75 @@ jobs:
8989
name: debs
9090
path: debs/*
9191

92+
build-wheels:
93+
name: Build wheels on ${{ matrix.os }}
94+
runs-on: ${{ matrix.os }}
95+
strategy:
96+
matrix:
97+
os: [ubuntu-20.04, macos-10.15]
98+
is_pr:
99+
- ${{ startsWith(github.ref, 'refs/pull/') }}
100+
101+
exclude:
102+
# Don't build macos wheels on PR CI.
103+
- is_pr: true
104+
os: "macos-10.15"
105+
106+
steps:
107+
- uses: actions/checkout@v3
108+
109+
- uses: actions/setup-python@v3
110+
111+
- name: Install cibuildwheel
112+
run: python -m pip install cibuildwheel==2.9.0 poetry==1.2.0
113+
114+
# Only build a single wheel in CI.
115+
- name: Set env vars.
116+
run: |
117+
echo "CIBW_BUILD="cp37-manylinux_x86_64"" >> $GITHUB_ENV
118+
if: startsWith(github.ref, 'refs/pull/')
119+
120+
- name: Build wheels
121+
run: python -m cibuildwheel --output-dir wheelhouse
122+
env:
123+
# Skip testing for platforms which various libraries don't have wheels
124+
# for, and so need extra build deps.
125+
CIBW_TEST_SKIP: pp39-* *i686* *musl* pp37-macosx*
126+
127+
- uses: actions/upload-artifact@v3
128+
with:
129+
name: Wheel
130+
path: ./wheelhouse/*.whl
131+
92132
build-sdist:
93-
name: "Build pypi distribution files"
94-
uses: "matrix-org/backend-meta/.github/workflows/packaging.yml@v1"
133+
name: Build sdist
134+
runs-on: ubuntu-latest
135+
if: ${{ !startsWith(github.ref, 'refs/pull/') }}
136+
137+
steps:
138+
- uses: actions/checkout@v3
139+
- uses: actions/setup-python@v4
140+
with:
141+
python-version: '3.10'
142+
143+
- run: pip install build
144+
145+
- name: Build sdist
146+
run: python -m build --sdist
147+
148+
- uses: actions/upload-artifact@v2
149+
with:
150+
name: Sdist
151+
path: dist/*.tar.gz
152+
95153

96154
# if it's a tag, create a release and attach the artifacts to it
97155
attach-assets:
98156
name: "Attach assets to release"
99157
if: ${{ !failure() && !cancelled() && startsWith(github.ref, 'refs/tags/') }}
100158
needs:
101159
- build-debs
160+
- build-wheels
102161
- build-sdist
103162
runs-on: ubuntu-latest
104163
steps:

0 commit comments

Comments
 (0)