reade for release
cargo devel CI / cargo CI (push) Has been cancelled Details

This commit is contained in:
Christoph J. Scherr 2024-01-24 22:01:25 +01:00
parent 52ac674e50
commit 6ed9ad3569
Signed by: PlexSheep
GPG Key ID: 7CDD0B14851A08EF
6 changed files with 35 additions and 33 deletions

View File

@ -1,4 +1,3 @@
workspace = { members = ["spammer"] }
[package]
name = "netpong"
version = "0.2.1"

View File

@ -1,5 +0,0 @@
#!/bin/bash
mkdir data
echo create ca
# non-interactive and 10 years expiration
openssl req -x509 -nodes -newkey rsa:4096 -keyout data/key.pem -out data/cert.pem -sha256 -days 3650 -subj '/CN=localhost'

11
scripts/publish.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -e
cargo check --all-features
echo ">>>>>>>> PUBLISHING RELEASE FOR REPO"
bash scripts/release.sh
echo ">>>>>>>> PUBLISHING TO CRATES.IO NEXT"
sleep 2
cargo publish
echo ">>>>>>>> PUBLISHING TO CSCHERR.DE NEXT"
sleep 2
cargo publish --registry cscherr

24
scripts/release.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
TOKEN=$(cat ~/.git-credentials | grep 'git.cscherr.de' | grep -P '(?:)[^:]*(?=@)' -o)
NEW_VERSION=$(cat Cargo.toml | rg '^\s*version\s*=\s*"([^"]*)"\s*$' -or '$1')
GIT_COMMIT_SHA=$(git rev-parse HEAD)
REPO=${PWD##*/} # name of cwd
BODY="
$(git log $(git describe --tags --abbrev=0)..HEAD --pretty="- %s" --oneline --decorate)
"
USER=PlexSheep
git tag "v$NEW_VERSION-test" || echo "could not tag"
curl -X 'POST' \
'https://git.cscherr.de/api/v1/repos/PlexSheep/'$REPO'/releases' \
-H 'accept: application/json' \
-H "Authorization: token $TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"body": "'"$BODY"'",
"draft": false,
"name": "v'$NEW_VERSION'",
"prerelease": true,
"tag_name": "v'$NEW_VERSION'",
"target_commitish": "'$GIT_COMMIT_SHA'"
}' | python -m json.tool
git push || echo "could not push"

View File

@ -1,9 +0,0 @@
[package]
name = "spammer"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
threadpool = "1.8.1"

View File

@ -1,18 +0,0 @@
use threadpool::ThreadPool;
const MAX: usize = 20;
use std::process::Command;
fn main() {
let pool = ThreadPool::new(MAX);
loop {
if pool.queued_count() < MAX {
pool.execute(|| {
let mut cmd = Command::new("/usr/bin/python3");
cmd.args(["../scripts/client.py"]);
let _ = cmd.output().unwrap();
});
}
std::thread::sleep(std::time::Duration::from_millis(100));
}
}