From 981444e0fccaa74962930fd51b4f78cdb9f0b317 Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Sat, 17 Dec 2022 22:39:49 -0800 Subject: [PATCH 1/7] Fix LoadFolders --- LoadFolders.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LoadFolders.xml b/LoadFolders.xml index 93049fb..7be0397 100644 --- a/LoadFolders.xml +++ b/LoadFolders.xml @@ -5,15 +5,15 @@
  • Content/Mods/VGE
  • Content/Mods/Milk
  • -
  • Content/Mods/Moyo
  • -
  • Content/Mods/Revia
  • +
  • Content/Mods/Moyo
  • +
  • Content/Mods/Revia
  • Content/Base
  • Content/Mods/VGE
  • Content/Mods/Milk
  • -
  • Content/Mods/Moyo
  • -
  • Content/Mods/Revia
  • +
  • Content/Mods/Moyo
  • +
  • Content/Mods/Revia
  • \ No newline at end of file From 39d9b1b04bb8faae40dd177a0368586cc96c5d89 Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Sun, 18 Dec 2022 19:34:36 -0800 Subject: [PATCH 2/7] Update CI --- .gitlab-ci.yml | 6 +++++- ReadMe.md | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dfc3bb8..534b777 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,7 @@ build: artifacts: paths: - build.zip + - LATEST_CHANGELOG upload: stage: upload @@ -29,6 +30,9 @@ upload: script: - | curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build.zip "${PACKAGE_REGISTRY_URL}/rjw-race-support.zip" + artifacts: + paths: + - LATEST_CHANGELOG release: stage: release @@ -39,4 +43,4 @@ release: - | release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \ --assets-link "{\"name\":\"Download Build\",\"url\":\"${PACKAGE_REGISTRY_URL}/rjw-race-support.zip\",\"filepath\":\"/rjw-race-support.zip\"}" \ - --description "Changelog goes here" \ No newline at end of file + --description (cat LATEST_CHANGELOG) \ No newline at end of file diff --git a/ReadMe.md b/ReadMe.md index d7255ad..c823a23 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -114,6 +114,7 @@ This mod requires RJW and must be placed somewhere below it. * Update milk mod support * FCP dogmeat * Alpha mythology +* Avali ### Test and improve * Race to the rim * Dragon's descent crossbreeding From a1a0021af82c7d45d37cc7bfa8161ef1c1e50a75 Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Sun, 18 Dec 2022 20:27:05 -0800 Subject: [PATCH 3/7] Add deployer --- deploy/Cargo.lock | 213 +++++++++++++++++++++++++++++++++++++++++++++ deploy/Cargo.toml | 9 ++ deploy/src/main.rs | 69 +++++++++++++++ 3 files changed, 291 insertions(+) create mode 100644 deploy/Cargo.lock create mode 100644 deploy/Cargo.toml create mode 100644 deploy/src/main.rs diff --git a/deploy/Cargo.lock b/deploy/Cargo.lock new file mode 100644 index 0000000..4ae1b23 --- /dev/null +++ b/deploy/Cargo.lock @@ -0,0 +1,213 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cc" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "deploy" +version = "0.1.0" +dependencies = [ + "git2", +] + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "git2" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + +[[package]] +name = "libc" +version = "0.2.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" + +[[package]] +name = "libgit2-sys" +version = "0.14.0+1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" diff --git a/deploy/Cargo.toml b/deploy/Cargo.toml new file mode 100644 index 0000000..407010d --- /dev/null +++ b/deploy/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "deploy" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +git2 = "*" \ No newline at end of file diff --git a/deploy/src/main.rs b/deploy/src/main.rs new file mode 100644 index 0000000..24f1bf1 --- /dev/null +++ b/deploy/src/main.rs @@ -0,0 +1,69 @@ +use std::io::{self, BufRead}; +use std::fs::{self, File}; +use std::env; +use std::path::Path; + +use git2::{Repository, Signature, ObjectType, Direction, RemoteCallbacks}; + +fn main() { + let args: Vec = env::args().collect(); + let version = args.into_iter().nth(1).unwrap(); + let latest_changelog_path = Path::new("../LATEST_CHANGELOG"); + let full_changelog_path = Path::new("../changelog.txt"); + + println!("Deploying version {}", version); + + let changelog = io::BufReader::new(File::open(latest_changelog_path).unwrap()).lines(); + let mut deploy_changelog = String::new(); + let mut latest_changelog = String::from(version.clone() + "\n"); + for line in changelog { + let line = line.unwrap(); + deploy_changelog.push_str(&format!("* {}\n", line)); + latest_changelog.push_str(&format!("-{}\n", line)); + } + latest_changelog.push('\n'); + + println!("{}", deploy_changelog); + + fs::write(latest_changelog_path, deploy_changelog).unwrap(); + let old_changelog = fs::read_to_string(full_changelog_path).unwrap(); + latest_changelog.push_str(&old_changelog); + fs::write(full_changelog_path, latest_changelog).unwrap(); + + let asmr_sig = Signature::now("AsmodeusRex", "dark.song2667@fastmail.com").unwrap(); + let bot_sig = Signature::now("ASMR_Deploy_Bot", "dark.song2667@fastmail.com").unwrap(); + + let repo = Repository::open("..").unwrap(); + let mut index = repo.index().unwrap(); + + index.add_path(Path::new("LATEST_CHANGELOG")).unwrap(); + index.add_path(Path::new("changelog.txt")).unwrap(); + let oid = index.write_tree().unwrap(); + + let obj = repo.head().unwrap().resolve().unwrap().peel(ObjectType::Commit).unwrap(); + let parent_commit = obj.into_commit().unwrap(); + let tree = repo.find_tree(oid).unwrap(); + + let oid = repo.commit(Some("HEAD"), + &asmr_sig, &bot_sig, + &format!("Update to {version}"), + &tree, &[&parent_commit] + ).unwrap(); + let target = repo.find_object(oid, Some(ObjectType::Commit)).unwrap(); + + repo.tag(&version, &target, &bot_sig, "", false).unwrap(); + + let mut callback = RemoteCallbacks::new(); + callback.credentials(|_, uname, _| { + git2::Cred::ssh_key( + uname.unwrap(), + None, + Path::new(&format!("{}/.ssh/id_rsa", env::var("HOME").unwrap())), + None, + ) + }); + let mut rem = repo.find_remote("origin").unwrap(); + let mut conn = rem.connect_auth(Direction::Push, Some(callback), None).unwrap(); + let remote = conn.remote(); + remote.push(&["refs/heads/master:refs/heads/master"], None).unwrap(); +} From 461c96f6dd9c2d705cd86e5731651aa905279b48 Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Tue, 20 Dec 2022 16:29:15 -0800 Subject: [PATCH 4/7] Update to 11.4.0 --- LATEST_CHANGELOG | 3 + changelog.txt | 9 +- deploy.ps1 | 22 +++++ deploy/Cargo.lock | 213 --------------------------------------------- deploy/Cargo.toml | 9 -- deploy/src/main.rs | 69 --------------- 6 files changed, 33 insertions(+), 292 deletions(-) create mode 100644 LATEST_CHANGELOG create mode 100644 deploy.ps1 delete mode 100644 deploy/Cargo.lock delete mode 100644 deploy/Cargo.toml delete mode 100644 deploy/src/main.rs diff --git a/LATEST_CHANGELOG b/LATEST_CHANGELOG new file mode 100644 index 0000000..9a2c399 --- /dev/null +++ b/LATEST_CHANGELOG @@ -0,0 +1,3 @@ +* Added deploy script +* Fixed LoadFolders for Revia and Moyo +* Added changelogs to release page diff --git a/changelog.txt b/changelog.txt index 0cf4a34..996c4ec 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +11.4.0 +-Added deploy script +-Fixed LoadFolders for Revia and Moyo +-Added changelogs to release page + 11.3.3 -Added support for DLC races @@ -358,4 +363,6 @@ Bovine Penis multi surgery bow require bovine penis and the label is fixed -tweak breeders delight -added length and width to custom parts -mist men now get parts and gender --Kijin hot Spring grants 10% fertility \ No newline at end of file +-Kijin hot Spring grants 10% fertility + + diff --git a/deploy.ps1 b/deploy.ps1 new file mode 100644 index 0000000..ffbd9fe --- /dev/null +++ b/deploy.ps1 @@ -0,0 +1,22 @@ +$l = ".\LATEST_CHANGELOG" +$c = ".\changelog.txt" +$m = "Update to " + $args[0] + +Write-Output ("Deploying version " + $args[0]) + +$a = Get-Content $l +$b = $a | ForEach-Object { "* " + $_ } +$b | Set-Content $l + +Write-Output $b + +$( + ($args[0]) + ($a | ForEach-Object { "-" + $_ }) + ("") + (Get-Content $c -Raw) +) | Set-Content $c + +git add $l $c +git commit -q --amend --no-edit +git tag $args[0] \ No newline at end of file diff --git a/deploy/Cargo.lock b/deploy/Cargo.lock deleted file mode 100644 index 4ae1b23..0000000 --- a/deploy/Cargo.lock +++ /dev/null @@ -1,213 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cc" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" -dependencies = [ - "jobserver", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "deploy" -version = "0.1.0" -dependencies = [ - "git2", -] - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "git2" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" -dependencies = [ - "bitflags", - "libc", - "libgit2-sys", - "log", - "openssl-probe", - "openssl-sys", - "url", -] - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "jobserver" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" -dependencies = [ - "libc", -] - -[[package]] -name = "libc" -version = "0.2.138" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" - -[[package]] -name = "libgit2-sys" -version = "0.14.0+1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b" -dependencies = [ - "cc", - "libc", - "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -] - -[[package]] -name = "libssh2-sys" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" diff --git a/deploy/Cargo.toml b/deploy/Cargo.toml deleted file mode 100644 index 407010d..0000000 --- a/deploy/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "deploy" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -git2 = "*" \ No newline at end of file diff --git a/deploy/src/main.rs b/deploy/src/main.rs deleted file mode 100644 index 24f1bf1..0000000 --- a/deploy/src/main.rs +++ /dev/null @@ -1,69 +0,0 @@ -use std::io::{self, BufRead}; -use std::fs::{self, File}; -use std::env; -use std::path::Path; - -use git2::{Repository, Signature, ObjectType, Direction, RemoteCallbacks}; - -fn main() { - let args: Vec = env::args().collect(); - let version = args.into_iter().nth(1).unwrap(); - let latest_changelog_path = Path::new("../LATEST_CHANGELOG"); - let full_changelog_path = Path::new("../changelog.txt"); - - println!("Deploying version {}", version); - - let changelog = io::BufReader::new(File::open(latest_changelog_path).unwrap()).lines(); - let mut deploy_changelog = String::new(); - let mut latest_changelog = String::from(version.clone() + "\n"); - for line in changelog { - let line = line.unwrap(); - deploy_changelog.push_str(&format!("* {}\n", line)); - latest_changelog.push_str(&format!("-{}\n", line)); - } - latest_changelog.push('\n'); - - println!("{}", deploy_changelog); - - fs::write(latest_changelog_path, deploy_changelog).unwrap(); - let old_changelog = fs::read_to_string(full_changelog_path).unwrap(); - latest_changelog.push_str(&old_changelog); - fs::write(full_changelog_path, latest_changelog).unwrap(); - - let asmr_sig = Signature::now("AsmodeusRex", "dark.song2667@fastmail.com").unwrap(); - let bot_sig = Signature::now("ASMR_Deploy_Bot", "dark.song2667@fastmail.com").unwrap(); - - let repo = Repository::open("..").unwrap(); - let mut index = repo.index().unwrap(); - - index.add_path(Path::new("LATEST_CHANGELOG")).unwrap(); - index.add_path(Path::new("changelog.txt")).unwrap(); - let oid = index.write_tree().unwrap(); - - let obj = repo.head().unwrap().resolve().unwrap().peel(ObjectType::Commit).unwrap(); - let parent_commit = obj.into_commit().unwrap(); - let tree = repo.find_tree(oid).unwrap(); - - let oid = repo.commit(Some("HEAD"), - &asmr_sig, &bot_sig, - &format!("Update to {version}"), - &tree, &[&parent_commit] - ).unwrap(); - let target = repo.find_object(oid, Some(ObjectType::Commit)).unwrap(); - - repo.tag(&version, &target, &bot_sig, "", false).unwrap(); - - let mut callback = RemoteCallbacks::new(); - callback.credentials(|_, uname, _| { - git2::Cred::ssh_key( - uname.unwrap(), - None, - Path::new(&format!("{}/.ssh/id_rsa", env::var("HOME").unwrap())), - None, - ) - }); - let mut rem = repo.find_remote("origin").unwrap(); - let mut conn = rem.connect_auth(Direction::Push, Some(callback), None).unwrap(); - let remote = conn.remote(); - remote.push(&["refs/heads/master:refs/heads/master"], None).unwrap(); -} From d7463fd566f36ea8e536afa26b949646c07c0bec Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Tue, 20 Dec 2022 16:36:03 -0800 Subject: [PATCH 5/7] Update deploy script --- deploy.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy.ps1 b/deploy.ps1 index ffbd9fe..492c4a1 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -1,3 +1,6 @@ +Write-Output "Wait! Did you update LATEST_CHANGELOG?" +pause + $l = ".\LATEST_CHANGELOG" $c = ".\changelog.txt" $m = "Update to " + $args[0] @@ -18,5 +21,6 @@ $( ) | Set-Content $c git add $l $c -git commit -q --amend --no-edit -git tag $args[0] \ No newline at end of file +git commit -q -m $m +git tag $args[0] +git push origin $args[0] \ No newline at end of file From 8cbc499365b66efcf393ebf18c72d0944dd03f81 Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Tue, 20 Dec 2022 16:41:35 -0800 Subject: [PATCH 6/7] Update CI --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 534b777..33793ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,4 +43,4 @@ release: - | release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \ --assets-link "{\"name\":\"Download Build\",\"url\":\"${PACKAGE_REGISTRY_URL}/rjw-race-support.zip\",\"filepath\":\"/rjw-race-support.zip\"}" \ - --description (cat LATEST_CHANGELOG) \ No newline at end of file + --description $(head -n 1 LATEST_CHANGELOG) \ No newline at end of file From e6dd981321dca72416fd8ff24ade24b225971a03 Mon Sep 17 00:00:00 2001 From: AsmodeusRex Date: Tue, 20 Dec 2022 17:13:33 -0800 Subject: [PATCH 7/7] Revert changes to CI --- .gitlab-ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 33793ee..dfc3bb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,6 @@ build: artifacts: paths: - build.zip - - LATEST_CHANGELOG upload: stage: upload @@ -30,9 +29,6 @@ upload: script: - | curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file build.zip "${PACKAGE_REGISTRY_URL}/rjw-race-support.zip" - artifacts: - paths: - - LATEST_CHANGELOG release: stage: release @@ -43,4 +39,4 @@ release: - | release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \ --assets-link "{\"name\":\"Download Build\",\"url\":\"${PACKAGE_REGISTRY_URL}/rjw-race-support.zip\",\"filepath\":\"/rjw-race-support.zip\"}" \ - --description $(head -n 1 LATEST_CHANGELOG) \ No newline at end of file + --description "Changelog goes here" \ No newline at end of file