Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
Paul van Tilburg | a05106fecf | |
Paul van Tilburg | c128bfea62 | |
Paul van Tilburg | f7a5477804 | |
Paul van Tilburg | 9fc9990c27 | |
Paul van Tilburg | 05f88dbb9e | |
Paul van Tilburg | 409a69604e | |
Paul van Tilburg | b958734e92 |
|
@ -1,83 +0,0 @@
|
||||||
name: "Check, Test and Lint Using Cargo"
|
|
||||||
|
|
||||||
on:
|
|
||||||
- push
|
|
||||||
- pull_request
|
|
||||||
- workflow_dispatch
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
name: Check
|
|
||||||
runs-on: debian-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout sources
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install stable toolchain
|
|
||||||
uses: https://github.com/actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- name: Use sparse Cargo index for crates.io
|
|
||||||
run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
|
|
||||||
|
|
||||||
- name: Run cargo check
|
|
||||||
uses: https://github.com/actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: check
|
|
||||||
|
|
||||||
# TODO: Add a test suite first!
|
|
||||||
# test:
|
|
||||||
# name: Test Suite
|
|
||||||
# runs-on: debian-latest
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout sources
|
|
||||||
# uses: actions/checkout@v3
|
|
||||||
#
|
|
||||||
# - name: Install stable toolchain
|
|
||||||
# uses: https://github.com/actions-rs/toolchain@v1
|
|
||||||
# with:
|
|
||||||
# profile: minimal
|
|
||||||
# toolchain: stable
|
|
||||||
# override: true
|
|
||||||
#
|
|
||||||
# - name: Use sparse Cargo index for crates.io
|
|
||||||
# run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
|
|
||||||
#
|
|
||||||
# - name: Run cargo test
|
|
||||||
# uses: https://github.com/actions-rs/cargo@v1
|
|
||||||
# with:
|
|
||||||
# command: test
|
|
||||||
# args: --all-features
|
|
||||||
|
|
||||||
lints:
|
|
||||||
name: Lints
|
|
||||||
runs-on: debian-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout sources
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install stable toolchain
|
|
||||||
uses: https://github.com/actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
profile: minimal
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: Use sparse Cargo index for crates.io
|
|
||||||
run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
|
|
||||||
|
|
||||||
- name: Run cargo fmt
|
|
||||||
uses: https://github.com/actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: --all -- --check
|
|
||||||
|
|
||||||
- name: Run cargo clippy
|
|
||||||
uses: https://github.com/actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: clippy
|
|
||||||
args: -- -D warnings
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
name: "Check and lint using Cargo"
|
||||||
|
|
||||||
|
on:
|
||||||
|
- pull_request
|
||||||
|
- push
|
||||||
|
- workflow_dispatch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_lint:
|
||||||
|
name: Check and lint
|
||||||
|
runs-on: debian-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install Rust stable toolchain
|
||||||
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
- name: Run cargo check
|
||||||
|
uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: check
|
||||||
|
|
||||||
|
- name: Run cargo clippy
|
||||||
|
uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
args: -- -D warnings
|
||||||
|
|
||||||
|
- name: Run cargo fmt
|
||||||
|
uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: fmt
|
||||||
|
args: --all -- --check
|
||||||
|
|
||||||
|
# TODO: Add a test suite first!
|
||||||
|
# - name: Run cargo test
|
||||||
|
# uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
# with:
|
||||||
|
# command: test
|
||||||
|
# args: --all-features
|
|
@ -0,0 +1,82 @@
|
||||||
|
name: "Release"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: "Release"
|
||||||
|
runs-on: debian-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Determine the version of the release
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF_NAME#v}
|
||||||
|
echo "Releasing version: $VERSION"
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install Rust stable toolchain
|
||||||
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Install cargo-deb
|
||||||
|
uses: https://github.com/brndnmtthws/rust-action-cargo-binstall@v1
|
||||||
|
with:
|
||||||
|
packages: cargo-deb
|
||||||
|
|
||||||
|
- name: Run cargo-deb
|
||||||
|
uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: deb
|
||||||
|
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
|
||||||
|
- name: Release to Gitea
|
||||||
|
uses: actions/release-action@main
|
||||||
|
with:
|
||||||
|
# This is available by default.
|
||||||
|
api_key: '${{ secrets.RELEASE_TOKEN }}'
|
||||||
|
files: target/debian/podbringer*.deb
|
||||||
|
title: 'Release ${{ env.VERSION }}'
|
||||||
|
|
||||||
|
release-crate:
|
||||||
|
name: "Release crate"
|
||||||
|
runs-on: debian-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Rust stable toolchain
|
||||||
|
uses: https://github.com/actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
|
||||||
|
- name: Use sparse Cargo index for crates.io
|
||||||
|
run: echo -e '[registries.crates-io]\nprotocol = "sparse"' >> /root/.cargo/config.toml
|
||||||
|
|
||||||
|
- name: Register the Gitea crate registry with Cargo
|
||||||
|
run: echo -e '[registries.luon]\nindex = "https://git.luon.net/paul/_cargo-index.git"' >> /root/.cargo/config.toml
|
||||||
|
|
||||||
|
- name: Run cargo publish
|
||||||
|
uses: https://github.com/actions-rs/cargo@v1
|
||||||
|
env:
|
||||||
|
# This needs to be provided for the repository; no login necessary as a result.
|
||||||
|
CARGO_REGISTRIES_LUON_TOKEN: '${{ secrets.CARGO_REGISTRIES_LUON_TOKEN }}'
|
||||||
|
with:
|
||||||
|
command: publish
|
||||||
|
args: --registry luon
|
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.5.0] - 2023-06-08
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* Add full release Gitea Actions workflow
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* Simplify GItea Actions check and lint workflow
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Differentiate between publish and update time for items
|
||||||
|
|
||||||
## [0.4.1] - 2023-04-11
|
## [0.4.1] - 2023-04-11
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -93,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
Initial release.
|
Initial release.
|
||||||
|
|
||||||
[Unreleased]: https://git.luon.net/paul/podbringer/compare/v0.4.1...HEAD
|
[Unreleased]: https://git.luon.net/paul/podbringer/compare/v0.4.1...HEAD
|
||||||
|
[0.5.0]: https://git.luon.net/paul/podbringer/compare/v0.4.1..v0.5.0
|
||||||
[0.4.1]: https://git.luon.net/paul/podbringer/compare/v0.4.0..v0.4.1
|
[0.4.1]: https://git.luon.net/paul/podbringer/compare/v0.4.0..v0.4.1
|
||||||
[0.4.0]: https://git.luon.net/paul/podbringer/compare/v0.3.0..v0.4.0
|
[0.4.0]: https://git.luon.net/paul/podbringer/compare/v0.3.0..v0.4.0
|
||||||
[0.3.0]: https://git.luon.net/paul/podbringer/compare/v0.2.0..v0.3.0
|
[0.3.0]: https://git.luon.net/paul/podbringer/compare/v0.2.0..v0.3.0
|
||||||
|
|
|
@ -1495,7 +1495,7 @@ checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "podbringer"
|
name = "podbringer"
|
||||||
version = "0.4.1"
|
version = "0.5.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"cached",
|
"cached",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "podbringer"
|
name = "podbringer"
|
||||||
version = "0.4.1"
|
version = "0.5.0"
|
||||||
authors = ["Paul van Tilburg <paul@luon.net>"]
|
authors = ["Paul van Tilburg <paul@luon.net>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Web service that provides podcasts for services that don't offer them (anymore)"
|
description = "Web service that provides podcasts for services that don't offer them (anymore)"
|
||||||
|
|
|
@ -109,6 +109,9 @@ pub(crate) struct Item {
|
||||||
/// The URL of the image of the item.
|
/// The URL of the image of the item.
|
||||||
pub(crate) image: Option<Url>,
|
pub(crate) image: Option<Url>,
|
||||||
|
|
||||||
|
/// The timestamp the item was published.
|
||||||
|
pub(crate) published_at: DateTime<Utc>,
|
||||||
|
|
||||||
/// The timestamp the item was last updated.
|
/// The timestamp the item was last updated.
|
||||||
pub(crate) updated_at: DateTime<Utc>,
|
pub(crate) updated_at: DateTime<Utc>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,10 @@ pub(crate) struct Cloudcast {
|
||||||
/// The tags of the cloudcast.
|
/// The tags of the cloudcast.
|
||||||
pub(crate) tags: Vec<Tag>,
|
pub(crate) tags: Vec<Tag>,
|
||||||
|
|
||||||
/// The time the feed was created/started.
|
/// The time the feed was created.
|
||||||
|
pub(crate) created_time: DateTime<Utc>,
|
||||||
|
|
||||||
|
/// The time the feed was updated.
|
||||||
pub(crate) updated_time: DateTime<Utc>,
|
pub(crate) updated_time: DateTime<Utc>,
|
||||||
|
|
||||||
/// The original URL of the cloudcast.
|
/// The original URL of the cloudcast.
|
||||||
|
@ -227,6 +230,7 @@ impl From<Cloudcast> for Item {
|
||||||
guid: cloudcast.slug,
|
guid: cloudcast.slug,
|
||||||
keywords,
|
keywords,
|
||||||
image: Some(cloudcast.pictures.large),
|
image: Some(cloudcast.pictures.large),
|
||||||
|
published_at: cloudcast.created_time,
|
||||||
updated_at: cloudcast.updated_time,
|
updated_at: cloudcast.updated_time,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,9 @@ impl From<YouTubeVideoWithStream> for Item {
|
||||||
.date()
|
.date()
|
||||||
.and_hms_opt(12, 0, 0)
|
.and_hms_opt(12, 0, 0)
|
||||||
.expect("Invalid hour, minute and/or second");
|
.expect("Invalid hour, minute and/or second");
|
||||||
let updated_at = DateTime::from_utc(timestamp, Utc);
|
let published_at = DateTime::from_utc(timestamp, Utc);
|
||||||
|
// There is no updated at timestamp available, really.
|
||||||
|
let updated_at = published_at;
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
title: video.title().to_string(),
|
title: video.title().to_string(),
|
||||||
|
@ -236,6 +238,7 @@ impl From<YouTubeVideoWithStream> for Item {
|
||||||
guid: id,
|
guid: id,
|
||||||
keywords,
|
keywords,
|
||||||
image,
|
image,
|
||||||
|
published_at,
|
||||||
updated_at,
|
updated_at,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ fn construct_item(
|
||||||
.categories(categories)
|
.categories(categories)
|
||||||
.enclosure(Some(enclosure))
|
.enclosure(Some(enclosure))
|
||||||
.guid(Some(guid))
|
.guid(Some(guid))
|
||||||
.pub_date(Some(item.updated_at.to_rfc2822()))
|
.pub_date(Some(item.published_at.to_rfc2822()))
|
||||||
.itunes_ext(Some(itunes_ext))
|
.itunes_ext(Some(itunes_ext))
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue