diff --git a/.changesets/.gitkeep b/.changesets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.changesets/initial-release.md b/.changesets/initial-release.md new file mode 100644 index 0000000..c8e9beb --- /dev/null +++ b/.changesets/initial-release.md @@ -0,0 +1,6 @@ +--- +bump: minor +type: add +--- + +Initial release diff --git a/.github/workflows/publish_release.yaml b/.github/workflows/publish_release.yaml new file mode 100644 index 0000000..f6d3523 --- /dev/null +++ b/.github/workflows/publish_release.yaml @@ -0,0 +1,75 @@ +name: Publish a release +on: + # Trigger this release via the GitHub Actions interface for this workflow + workflow_dispatch: + +env: + PUBLISH_GIT_USERNAME: "AppSignal release bot" + PUBLISH_GIT_EMAIL: "support+build-sign@appsignal.com" + PUBLISH_GIT_SSH_PATH: "/home/runner/.ssh" + PUBLISH_GIT_SIGN_KEY_PATH: "/home/runner/.ssh/sign_key" + +jobs: + publish: + name: "Publish the release" + runs-on: ubuntu-22.04 + steps: + - name: "Checkout the project" + uses: actions/checkout@v4 + with: + ssh-key: "${{secrets.PUBLISH_DEPLOY_KEY}}" + path: "main" + + - name: "Checkout Mono" + uses: actions/checkout@v4 + with: + repository: "appsignal/mono" + path: "mono" + + - name: "Configure Git" + run: | + mkdir -p "$PUBLISH_GIT_SSH_PATH" + echo "${{secrets.PUBLISH_GIT_SIGN_KEY}}" > "$PUBLISH_GIT_SIGN_KEY_PATH" + echo "${{secrets.PUBLISH_GIT_SIGN_PUBLIC_KEY}}" > "$PUBLISH_GIT_SIGN_KEY_PATH.pub" + chmod 600 "$PUBLISH_GIT_SIGN_KEY_PATH" + git config --global user.name "$PUBLISH_GIT_USERNAME (as ${{github.actor}})" + git config --global user.email "$PUBLISH_GIT_EMAIL" + git config --global gpg.format ssh + git config --global commit.gpgsign true + touch ~/.ssh/allowed_signers + echo "$(git config --get user.email) namespaces=\"git\" $(cat $PUBLISH_GIT_SIGN_KEY_PATH.pub)" >> ~/.ssh/allowed_signers + git config --global user.signingkey "$PUBLISH_GIT_SIGN_KEY_PATH" + + - name: "Install Cross" + run: | + cargo install cross + + - name: "Login to Docker Hub" + uses: docker/login-action@v3 + with: + username: ${{secrets.PUBLISH_DOCKERHUB_USERNAME}} + password: ${{secrets.PUBLISH_DOCKERHUB_TOKEN}} + + - name: "Build artifacts and push release tag" + id: version + working-directory: "./main" + run: | + ../mono/bin/mono publish --no-package-push --yes + + export RELEASE_VERSION="$(script/read_version)" + echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_OUTPUT" + echo "TAG_NAME=v$RELEASE_VERSION" >> "$GITHUB_OUTPUT" + + - name: "Create a release on the repository" + working-directory: "./main" + run: | + gh release create ${{steps.version.outputs.TAG_NAME}} \ + --title "${{steps.version.outputs.RELEASE_VERSION}}" \ + --notes-from-tag \ + --verify-tag \ + 'release/x86_64-unknown-linux-gnu.tar.gz#Linux (x86_64)' \ + 'release/x86_64-unknown-linux-musl.tar.gz#Linux (x86_64, musl)' \ + 'release/aarch64-unknown-linux-gnu.tar.gz#Linux (arm64)' \ + 'release/aarch64-unknown-linux-musl.tar.gz#Linux (arm64, musl)' + env: + GH_TOKEN: ${{github.token}} diff --git a/.gitignore b/.gitignore index ea8c4bf..ecb817e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/release diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..32a1208 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +# `appsignal-wrap` changelog + diff --git a/Cargo.lock b/Cargo.lock index 440f259..b0a2cba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -87,12 +87,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "appsignal-wrap" -version = "0.1.0" +version = "0.0.0" dependencies = [ "chrono", "clap", @@ -110,12 +110,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" @@ -248,31 +242,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - [[package]] name = "env_filter" version = "0.1.2" @@ -296,49 +271,12 @@ dependencies = [ "log", ] -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -417,37 +355,12 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "heck" version = "0.5.0" @@ -521,7 +434,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -547,22 +459,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -617,16 +514,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown 0.15.0", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -660,12 +547,6 @@ version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -712,24 +593,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -768,50 +632,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[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.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -853,12 +673,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -877,6 +691,53 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -962,38 +823,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1009,7 +869,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1019,17 +879,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustls" @@ -1038,6 +891,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1076,44 +930,12 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "serde" version = "1.0.210" @@ -1195,7 +1017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1237,37 +1059,23 @@ dependencies = [ ] [[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" +name = "thiserror" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ - "core-foundation-sys", - "libc", + "thiserror-impl", ] [[package]] -name = "tempfile" -version = "3.13.0" +name = "thiserror-impl" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1300,7 +1108,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1314,16 +1122,6 @@ dependencies = [ "syn", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1356,7 +1154,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "hashbrown 0.14.5", + "hashbrown", "pin-project-lite", "tokio", ] @@ -1374,9 +1172,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tracing-core" version = "0.1.32" @@ -1436,12 +1246,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "want" version = "0.3.1" @@ -1534,6 +1338,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -1582,15 +1395,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index e10635c..a191f54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "appsignal-wrap" -version = "0.1.0" +version = "0.0.0" edition = "2021" [dependencies] @@ -11,7 +11,7 @@ hex = "0.4.3" env_logger = "0.11.5" log = { version = "0.4.22", features = ["max_level_trace", "release_max_level_warn"] } nix = { version = "0.29.0", features = ["hostname", "signal"] } -reqwest = "0.12.8" +reqwest = { version = "0.12.8", default-features = false, features = ["rustls-tls"] } serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" tokio = { version = "1.40.0", features = ["full"] } diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 0000000..f448be7 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,16 @@ +[build.env] +passthrough = [ + "PKG_CONFIG_ALLOW_CROSS" +] + +[target.x86_64-unknown-linux-gnu] +image = "appsignal/agent-x86_64-unknown-linux-gnu:3" + +[target.x86_64-unknown-linux-musl] +image = "appsignal/agent-x86_64-unknown-linux-musl:3" + +[target.aarch64-unknown-linux-gnu] +image = "appsignal/agent-aarch64-unknown-linux-gnu:3" + +[target.aarch64-unknown-linux-musl] +image = "appsignal/agent-aarch64-unknown-linux-musl:3" diff --git a/mono.yml b/mono.yml new file mode 100644 index 0000000..269ba0f --- /dev/null +++ b/mono.yml @@ -0,0 +1,13 @@ +--- +language: "custom" +repo: "https://github.com/appsignal/appsignal-wrap" +build: + command: "script/build_artifacts" +publish: + command: "echo 'Can only publish from GitHub Actions'" +test: + command: "cargo test" + +read_version: "script/read_version" +write_version: "script/write_version" +version_scheme: "semver" diff --git a/script/build_artifact b/script/build_artifact new file mode 100755 index 0000000..d531e0d --- /dev/null +++ b/script/build_artifact @@ -0,0 +1,17 @@ +#!/bin/sh + +set -eu + +TARGET=$1 + +mkdir release > /dev/null 2>&1 || true +rm -rf target + +echo "Building for \`$TARGET\`..." +echo + +cross build --release --target $TARGET +tar -czvf release/$TARGET.tar.gz -C target/$TARGET/release appsignal-wrap + +echo "Done! Built release at \`release/$TARGET.tar.gz\`." +echo diff --git a/script/build_artifacts b/script/build_artifacts new file mode 100755 index 0000000..93321b5 --- /dev/null +++ b/script/build_artifacts @@ -0,0 +1,8 @@ +#!/bin/sh + +rm -rf release + +script/build_artifact x86_64-unknown-linux-gnu +script/build_artifact x86_64-unknown-linux-musl +script/build_artifact aarch64-unknown-linux-gnu +script/build_artifact aarch64-unknown-linux-musl diff --git a/script/read_version b/script/read_version new file mode 100755 index 0000000..df93e97 --- /dev/null +++ b/script/read_version @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eu + +grep -e '^version =' Cargo.toml | cut -d '"' -f 2 diff --git a/script/write_version b/script/write_version new file mode 100755 index 0000000..9053a11 --- /dev/null +++ b/script/write_version @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +VERSION=ARGV[0] + +File.write( + "Cargo.toml", + File.read("Cargo.toml").sub(/^version = ".*"$/, %(version = "#{VERSION}")) +)