1 Commits

Author SHA1 Message Date
006bb3d9bb Add gitea release workflow
Some checks reported warnings
CI / CI (push) Has been cancelled
2023-09-19 23:14:25 -07:00
6 changed files with 52 additions and 56 deletions

View File

@ -9,7 +9,7 @@ jobs:
name: CI name: CI
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: https://gitea.com/actions/checkout@v3 - uses: actions/checkout@v3
- uses: https://github.com/actions-rs/toolchain@v1 - uses: https://github.com/actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable

View File

@ -1,14 +1,13 @@
name: Release name: Release
on: on:
push: push:
tags: - tags "v*.*.*"
- "v*.*.*"
jobs: jobs:
release-crate: release-crate:
name: Publish to crates.io name: Publish to crates.io
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: https://gitea.com/actions/checkout@v3 - uses: actions/checkout@v2
- uses: https://github.com/actions-rs/toolchain@v1 - uses: https://github.com/actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
@ -19,24 +18,24 @@ jobs:
name: Publish to Docker Hub name: Publish to Docker Hub
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: https://gitea.com/actions/checkout@v3 - uses: actions/checkout@v2
- name: docker meta - name: docker meta
id: meta id: meta
uses: https://github.com/docker/metadata-action@v4 uses: https://github.com/docker/metadata-action@v5
with: with:
images: | images:
kelnos/bebot - kelnos/bebot
tags: | tags:
type=semver,pattern={{version}} - type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}} - type=semver,pattern={{major}}
- uses: https://gitea.com/docker/setup-qemu-action@v2 - uses: docker/setup-qemu-action@v3
- uses: https://gitea.com/docker/setup-buildx-action@v2 - uses: docker/setup-buildx-action@v3
- uses: https://gitea.com/docker/login-action@v2 - uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }} password: ${{ secrets.DOCKERHUB_PASSWORD }}
- uses: https://gitea.com/docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with: with:
context: . context: .
push: true push: true

66
Cargo.lock generated
View File

@ -30,9 +30,9 @@ dependencies = [
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "1.1.1" version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@ -89,7 +89,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -100,7 +100,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -152,7 +152,7 @@ checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2"
[[package]] [[package]]
name = "bebot" name = "bebot"
version = "0.1.2" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"constant_time_eq", "constant_time_eq",
@ -469,7 +469,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -534,7 +534,7 @@ checksum = "913dce4c5f06c2ea40fc178c06f777ac89fc6b1383e90c254fafb1abe4ba3c82"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
"uuid", "uuid",
] ]
@ -615,9 +615,9 @@ dependencies = [
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.3" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"
[[package]] [[package]]
name = "http" name = "http"
@ -1057,7 +1057,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -1354,9 +1354,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.14" version = "0.38.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662"
dependencies = [ dependencies = [
"bitflags 2.4.0", "bitflags 2.4.0",
"errno", "errno",
@ -1441,7 +1441,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -1512,9 +1512,9 @@ dependencies = [
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.11.1" version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9"
[[package]] [[package]]
name = "socket2" name = "socket2"
@ -1567,9 +1567,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.37" version = "2.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -1578,9 +1578,9 @@ dependencies = [
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.3.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]
@ -1602,7 +1602,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -1645,7 +1645,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -1683,9 +1683,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-util" name = "tokio-util"
version = "0.7.9" version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d"
dependencies = [ dependencies = [
"bytes", "bytes",
"futures-core", "futures-core",
@ -1748,7 +1748,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]
[[package]] [[package]]
@ -1787,9 +1787,9 @@ dependencies = [
[[package]] [[package]]
name = "typenum" name = "typenum"
version = "1.17.0" version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
[[package]] [[package]]
name = "unicase" name = "unicase"
@ -1932,7 +1932,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -1966,7 +1966,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -2032,9 +2032,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]] [[package]]
name = "winapi-util" name = "winapi-util"
version = "0.1.6" version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [ dependencies = [
"winapi", "winapi",
] ]
@ -2132,9 +2132,9 @@ dependencies = [
[[package]] [[package]]
name = "zeroize" name = "zeroize"
version = "1.6.0" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd"
dependencies = [ dependencies = [
"zeroize_derive", "zeroize_derive",
] ]
@ -2147,5 +2147,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.37", "syn 2.0.33",
] ]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "bebot" name = "bebot"
version = "0.1.2" version = "0.1.0"
description = "Gitlab webhook bot that publishes events to Matrix" description = "Gitlab webhook bot that publishes events to Matrix"
license = "GPL-3.0" license = "GPL-3.0"
authors = [ authors = [

View File

@ -58,6 +58,3 @@ logging verbosity. (Try `debug`, `info`, `warn` `error`, or `off`.)
A `Dockerfile` is also provided. When running the container it builds, A `Dockerfile` is also provided. When running the container it builds,
mount the configuration file so it appears inside the container as mount the configuration file so it appears inside the container as
`/bebot/config/bebot.yaml`. `/bebot/config/bebot.yaml`.
Release images are [published to Docker
Hub](https://hub.docker.com/r/kelnos/bebot).

View File

@ -185,7 +185,7 @@ impl fmt::Display for IssueAction {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct IssueObjectAttributes { pub struct IssueObjectAttributes {
pub iid: u32, pub id: u32,
pub title: String, pub title: String,
pub action: IssueAction, pub action: IssueAction,
pub url: String, pub url: String,
@ -406,7 +406,7 @@ impl GitlabEventExt for GitlabEvent {
if object_attributes.action != IssueAction::Other { if object_attributes.action != IssueAction::Other {
let title = format!( let title = format!(
"Issue #{} **{}**: {}", "Issue #{} **{}**: {}",
object_attributes.iid, object_attributes.action, object_attributes.title object_attributes.id, object_attributes.action, object_attributes.title
); );
vec![markdown_link(&title, &object_attributes.url)] vec![markdown_link(&title, &object_attributes.url)]
} else { } else {
@ -587,7 +587,7 @@ mod test {
.. ..
} => { } => {
assert_eq!(user.name, "Administrator"); assert_eq!(user.name, "Administrator");
assert_eq!(object_attributes.iid, 23); assert_eq!(object_attributes.id, 301);
assert_eq!(object_attributes.action, IssueAction::Open); assert_eq!(object_attributes.action, IssueAction::Open);
} }
_ => panic!("not an issue event"), _ => panic!("not an issue event"),