Compare commits

..

9 Commits

Author SHA1 Message Date
Jacob Kiers 86f3430993 Truncate the feed file before writing
continuous-integration/drone/push Build is passing Details
Otherwise, the feed may be overwritten, but if it is shorter, it may
contain some leftover data from a previous run. In that case, the file
will be invalid XML, thereby failing to be parsed.

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:34:53 +01:00
Jacob Kiers dae8c50564 Update changelog
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:34:51 +01:00
Jacob Kiers d9a8c56a7e Fix CS and some other small things
Useful tool, that clippy...

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:34:00 +01:00
Jacob Kiers 9aeb98b919 Put real feed url into feed
Instead of hardcoding the feed file name to be feed.atom, it has been
configurable for a while. This is now also reflected in the feed itself.

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:34:00 +01:00
Jacob Kiers cef6d5ad41 Use feed::set_stylesheet instead of hack
This was contributed in https://github.com/rust-syndication/atom/pull/68.

Closes #12.

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:34:00 +01:00
Jacob Kiers 3d7e5fc2cf Update to v0.2.2
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:18:43 +01:00
Jacob Kiers 78049cf7b6 Remove unnecessary docker-in-docker
continuous-integration/drone/push Build is passing Details
We're now launching new build servers, so security is less of a concern.

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 19:01:43 +01:00
Jacob Kiers 3abec884c2 Really remove targets I don't care about
continuous-integration/drone/push Build is passing Details
Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 18:43:56 +01:00
Jacob Kiers ea30a49901 Build with rust v1.66 and cross v0.2.4
Also added some sanity checks. The new docker image now also contains
all required targets and the rust-src component already, which makes it
a bit faster to get started.

Signed-off-by: Jacob Kiers <jacob@jacobkiers.net>
2022-12-16 18:42:38 +01:00
5 changed files with 25 additions and 42 deletions

3
.cargo/config.toml Normal file
View File

@ -0,0 +1,3 @@
[profile.release]
lto = "thin"
strip = true

View File

@ -1,10 +1,9 @@
local executableName = 'newsletter-to-web';
local cross_image = 'img.kie.rs/jjkiers/rust-dind-cross:1.66-full';
local archs = [
// { target: 'aarch64-unknown-linux-gnu', short: 'arm64-gnu' },
{ target: 'aarch64-unknown-linux-musl', short: 'arm64-musl' },
{ target: 'x86_64-pc-windows-gnu', short: 'windows' },
// { target: 'x86_64-unknown-linux-gnu', short: 'amd64-gnu' },
{ target: 'x86_64-unknown-linux-musl', short: 'amd64-musl' },
];
@ -16,15 +15,11 @@ local targetExecutableName(arch) = executableName + if std.startsWith(arch.short
local add_build_steps() = [
{
name: getStepName(arch),
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
image: cross_image,
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'rustup',
path: '/usr/local/rustup',
path: '/var/run/docker.sock',
},
],
commands: [
@ -34,7 +29,7 @@ local add_build_steps() = [
'rm -rf target/' + arch.target + '/release/*',
],
environment: {
CROSS_REMOTE: true,
CROSS_DOCKER_IN_DOCKER: true,
},
depends_on: ['Wait for Docker'],
}
@ -51,23 +46,29 @@ local add_build_steps() = [
steps:
[{
name: 'Wait for Docker',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.65-slim',
image: cross_image,
commands: [
'mkdir artifacts',
'echo Using image: ' + cross_image,
'while ! docker image ls; do sleep 1; done',
'cargo --version',
'rustc --version',
'docker info',
'docker pull hello-world:latest',
'mkdir artifacts',
],
environment: {
CROSS_DOCKER_IN_DOCKER: true,
},
volumes: [{
name: 'dockersock',
path: '/var/run',
path: '/var/run/docker.sock',
}],
}] +
add_build_steps() +
[
{
name: 'Show built artifacts',
image: 'img.kie.rs/jjkiers/rust-dind-cross:1.62-slim',
image: cross_image,
commands: [
'ls -lah artifacts',
],
@ -91,37 +92,11 @@ local add_build_steps() = [
},
],
services: [{
name: 'docker',
image: 'docker:dind',
privileged: true,
volumes: [
{
name: 'dockersock',
path: '/var/run',
},
{
name: 'docker-storage',
path: '/var/lib/docker',
},
],
}],
volumes: [
{
name: 'dockersock',
temp: {},
},
{
name: 'docker-storage',
host: {
path: '/srv/drone/docker-dind-rust',
},
},
{
name: 'rustup',
host: {
path: '/srv/drone/rustup',
path: '/var/run/docker.sock',
},
},
],

View File

@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Truncate feed file before writing, to prevent corruption from leftover data.
* Ensure the feed file name is part of the self URL. This was still hardcoded to `feed.atom`.
## [0.2.2] - 2022-12-16
### Changed
* Updated build pipeline to generate much smaller binaries
## [0.2.1] - 2022-12-13

2
Cargo.lock generated
View File

@ -529,7 +529,7 @@ checksum = "c96aba5aa877601bb3f6dd6a63a969e1f82e60646e81e71b14496995e9853c91"
[[package]]
name = "newsletter-to-web"
version = "0.2.0"
version = "0.2.2"
dependencies = [
"atom_syndication",
"base16ct",

View File

@ -1,6 +1,6 @@
[package]
name = "newsletter-to-web"
version = "0.2.0"
version = "0.2.2"
edition = "2021"
description = "Converts email newsletters to static HTML files"
homepage = "https://code.kiers.eu/newsletter-to-web/newsletter-to-web"