Skip to content

Commit 53cfea7

Browse files
authored
Merge pull request #25 from linksplatform/master
Master
2 parents 1a882d2 + 072918c commit 53cfea7

File tree

5 files changed

+64
-20
lines changed

5 files changed

+64
-20
lines changed

CodeChanges/AddNet6Support.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
find . -type f -name "*.yml" -print0 | xargs -0 sed -i -e 's/dotnet test -c Release -f net5/dotnet test -c Release -f net6/g'
55

66
# Add net6 target framework
7-
find . -type f -name "*.csproj" -print0 | xargs -0 sed -i -e 's|net5<\/TargetFrameworks|net5;net6<\/TargetFrameworks|g' -e 's|net5<\/TargetFrameworks|net5;net6<\/TargetFrameworks|g' -e 's|net5.0<\/TargetFrameworks|net5;net6<\/TargetFrameworks|g' -e 's|net5.0<\/TargetFrameworks|net5;net6<\/TargetFrameworks|g'
7+
find . -type f -name "*.csproj" -print0 | xargs -0 sed -i -e 's|net5<\/TargetFrameworks|net5;net6<\/TargetFrameworks|g' -e 's|net5.0<\/TargetFrameworks|net5;net6<\/TargetFrameworks|g'
88

99
# Replace application's target framework
1010
find . -type f -name "*.csproj" -print0 | xargs -0 sed -i -e 's|<TargetFramework>net5<\/TargetFramework>|<TargetFramework>net6<\/TargetFramework>|g' -e 's|<TargetFramework>net5.0<\/TargetFramework>|<TargetFramework>net6<\/TargetFramework>|g'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Change these values
4+
files_to_stage="."
5+
remote_name="origin";
6+
branch="main";
7+
commit_message="Message";
8+
9+
commit_and_push() {
10+
cd $subdirectory;
11+
git add ${files_to_stage};
12+
git commit -m "${commit_message}";
13+
git push ${remote_name} ${branch};
14+
cd ..;
15+
}
16+
17+
for subdirectory in ./*/;
18+
do
19+
commit_and_push &
20+
done;
21+
wait;

MultiProjectRepository/push-rust-cargo.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22
set -e # Exit with nonzero exit code if anything fails
33

44
RUST_PACKAGE_NAME=$(<RUST_PACKAGE_NAME.txt)
5-
RUST_PACKAGE_VERSION=$(<RUST_PACKAGE_VERSION.txt)
5+
RUST_PACKAGE_VERSION=$(head -n 1 RUST_PACKAGE_VERSION.txt)
6+
7+
> RUST_PACKAGE_NAME.txt
8+
> RUST_PACKAGE_VERSION.txt
69

710
# Ensure Cargo package does not exist
811
CargoPackageUrl="https://crates.io/api/v1/crates/$RUST_PACKAGE_NAME/$RUST_PACKAGE_VERSION/download"
912
CargoPageStatus="$(curl -ILs "$CargoPackageUrl")"
1013
# echo "$CargoPageStatus"
11-
if echo "$CargoPageStatus" | grep -q "HTTP/2 200"; then
12-
echo "Cargo with current version is already pushed."
13-
exit 0
14+
if echo "$CargoPageStatus" | grep -q "HTTP/2 200";
15+
then
16+
echo "Cargo with current version is already pushed."
17+
exit 0
18+
else
19+
if [ -z "$1" ]
20+
then
21+
cargo publish
22+
else
23+
cd $1
24+
cargo publish
25+
fi
1426
fi
1527

16-
echo "The cargo package does not exist at $CargoPackageUrl"
17-
18-
# Pack Cargo package
19-
# dotnet pack -c Release
20-
21-
# Push Cargo package
22-
# dotnet nuget push ./**/*.nupkg -s https://api.Cargo.org/v3/index.json --skip-duplicate -k "${CargoTOKEN}"
23-
24-
# Clean up
25-
# find . -type f -name '*.nupkg' -delete
26-
# find . -type f -name '*.snupkg' -delete
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/bash
22
set -e # Exit with nonzero exit code if anything fails
33

4-
RUST_PACKAGE_PROJECT_PATH="rust/Cargo.toml"
4+
RUST_PACKAGE_PROJECT_PATH="$1/Cargo.toml"
55
echo "$RUST_PACKAGE_PROJECT_PATH"
66
echo "$RUST_PACKAGE_PROJECT_PATH" > RUST_PACKAGE_PROJECT_PATH.txt
77
RUST_PACKAGE_NAME=$(cat "$RUST_PACKAGE_PROJECT_PATH" | grep -Po "name = \"\K[^\"]+" | head -1)
88
echo "$RUST_PACKAGE_NAME"
99
echo "$RUST_PACKAGE_NAME" > RUST_PACKAGE_NAME.txt
10-
RUST_PACKAGE_VERSION=$(cat "$RUST_PACKAGE_PROJECT_PATH" | grep "^version = " | grep -Eo "([0-9]|\.)+")
11-
echo "$RUST_PACKAGE_VERSION"
12-
echo "$RUST_PACKAGE_VERSION" > RUST_PACKAGE_VERSION.txt
10+
RUST_PACKAGE_VERSION=$(cat "$RUST_PACKAGE_PROJECT_PATH" | grep -Po "version = \"\K[^\"]+")
11+
echo "$RUST_PACKAGE_VERSION" > RUST_PACKAGE_VERSION.txt
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Make sure curl, perl and jq are installed
3+
4+
if [ -z "$1" ]
5+
then
6+
echo "Organization name is required. It should be the first argument."
7+
exit 1
8+
fi
9+
10+
repositories_json=$(curl -H "Accept: application/vnd.github.v3+json" "https://api.github.com/orgs/$1/repos?per_page=200");
11+
12+
clone() {
13+
clone_url=$(printf ${clone_url_with_double_quotes} | perl -pe 's~"(?<clone_url>.*)"~$+{clone_url}~g');
14+
echo "Cloning $clone_url_with_double_quotes..."
15+
git clone --depth 1 --recurse-submodules -j8 ${clone_url};
16+
echo "Done cloning $clone_url_with_double_quotes."
17+
}
18+
19+
for clone_url_with_double_quotes in $( printf "${repositories_json}" | jq '.[] | .clone_url' )
20+
do
21+
clone
22+
done;
23+
wait;

0 commit comments

Comments
 (0)