forked from pgcentralfoundation/pgrx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-versions.sh
executable file
·75 lines (62 loc) · 2.28 KB
/
update-versions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /usr/bin/env bash
#LICENSE Portions Copyright 2019-2021 ZomboDB, LLC.
#LICENSE
#LICENSE Portions Copyright 2021-2023 Technology Concepts & Design, Inc.
#LICENSE
#LICENSE Portions Copyright 2023-2023 PgCentral Foundation, Inc. <[email protected]>
#LICENSE
#LICENSE All rights reserved.
#LICENSE
#LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
# requires:
# * pgrx-version-updater (no intervention required -- built on demand from this project)
#
# To run this with more output, set environment variable VERBOSE to either 1 or true. E.g.
# $ VERBOSE=1 ./update-versions.sh 1.6.0
if [ "$1" == "" ]; then
echo "usage: ./update-versions.sh <VERSION>"
exit 1
fi
set -e
VERSION=$1
if [ "$VERBOSE" == "1" ] || [ "$VERBOSE" == "true" ]; then
echo "Verbose output requested."
VERBOSE=1
set -x
else
CARGO_QUIET_FLAG=-q
unset VERBOSE
fi
# INCLUDE_FOR_DEP_UPDATES specifies an array of relative paths that point to Cargo
# TOML files that are not automatically found by the pgrx-version-updater tool but
# still have PGRX dependencies that require updating.
INCLUDE_FOR_DEP_UPDATES=(
'cargo-pgrx/src/templates/cargo_toml'
'nix/templates/default/Cargo.toml'
)
# EXCLUDE_FROM_VERSION_BUMP specifies an array of relative paths that point to
# Cargo TOML files that should be *excluded* from package version bumps. Also used
# below to include all pgrx-example Cargo TOML files since they do not get their
# versions bumped at release time.
EXCLUDE_FROM_VERSION_BUMP=(
'cargo-pgrx/src/templates/cargo_toml'
'nix/templates/default/Cargo.toml'
'pgrx-version-updater/Cargo.toml'
)
# Exclude all pgrx-examples Cargo.toml files from version bumping
for file in pgrx-examples/**/Cargo.toml; do
EXCLUDE_FROM_VERSION_BUMP+=("$file")
done
# shellcheck disable=SC2086,SC2068
cargo run --bin pgrx-version-updater \
update-files \
--update-version "$VERSION" \
${INCLUDE_FOR_DEP_UPDATES[@]/#/-i } \
${EXCLUDE_FROM_VERSION_BUMP[@]/#/-e } \
${VERBOSE:+--show-diff} \
${VERBOSE:+--verbose}
echo "Upgrading dependency versions"
./upgrade-deps.sh
echo "Generating bindings -- this may take a few moments"
PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE=1 cargo test --no-run $CARGO_QUIET_FLAG --workspace --no-default-features --features "pg14"
echo "Done!"