Compare commits

...

14 Commits

Author SHA1 Message Date
Paul van Tilburg 3fed86d36f
Bump the version to 0.3.1
Check and lint using Cargo / Check and lint (push) Successful in 3m15s Details
Release / Release (push) Successful in 1m26s Details
Release / Release Rust crate (push) Successful in 4m15s Details
Release / Release Docker image (push) Successful in 11m37s Details
2023-08-26 11:50:26 +02:00
Paul van Tilburg d3cc19524b
Update the changelog 2023-08-26 11:48:55 +02:00
Paul van Tilburg 92c75d09b9
Fix and improve the release workflow
Ad the relevant part of the changelog as release notes to the release
and fix some schema-related issues.
2023-08-26 11:47:31 +02:00
Paul van Tilburg e1319dcfc2
Cargo update 2023-08-26 11:44:56 +02:00
Paul van Tilburg 0f1bc9d83d
Fix typo in comment
Check and lint using Cargo / Check and lint (push) Successful in 5m4s Details
2023-07-17 21:50:13 +02:00
Paul van Tilburg 0068f6e9de
Cargo update
Check and lint using Cargo / Check and lint (push) Successful in 3m9s Details
2023-06-08 11:10:06 +02:00
Paul van Tilburg caad71389b
Also here no longer set sparse Cargo index for crates.io
Check and lint using Cargo / Check and lint (push) Failing after 26s Details
2023-06-08 11:01:13 +02:00
Paul van Tilburg 0b76db96f0
Use the personal Cargo token
Check and lint using Cargo / Check and lint (push) Successful in 2m57s Details
2023-06-08 10:58:33 +02:00
Paul van Tilburg 42a43cc83d
No longer configure using a sparse Cargo index for crates.io
Check and lint using Cargo / Check and lint (push) Successful in 2m53s Details
This is the default since Rust 1.70.
2023-06-06 07:47:23 +02:00
Paul van Tilburg 1aca61d3fd
Add a full release workflow
Check and lint using Cargo / Check and lint (push) Successful in 2m45s Details
2023-05-22 20:02:03 +02:00
Paul van Tilburg 35dda781a3
Tweak workflow step name 2023-05-22 19:56:52 +02:00
Paul van Tilburg 14bda61a9e
Fix name of Gitea Actions workflow
Check and lint using Cargo / Check and lint (push) Successful in 3m2s Details
2023-04-25 16:30:05 +02:00
Paul van Tilburg bc22fd2d70
Run cargo clippy right after check; install missing components
Check, test and lint using Cargo / Check and lint (push) Successful in 2m57s Details
2023-04-25 16:28:02 +02:00
Paul van Tilburg fd00ef0b4f
Simplify Gitea Actions check and lint workflow
Check, test and lint using Cargo / Check and lint (push) Failing after 2m50s Details
2023-04-25 16:23:32 +02:00
8 changed files with 601 additions and 613 deletions

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,122 @@
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: Get the release notes from the changelog
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
RELEASE_NOTES=$(sed -n -e "/^## \[$VERSION\]/,/^## \[/{//"'!'"p;}" CHANGELOG.md | sed -e '1d;$d')
echo "Release notes:"
echo
echo "$RELEASE_NOTES"
echo "RELEASE_NOTES<<$EOF" >> "$GITHUB_ENV"
echo "$RELEASE_NOTES" >> "$GITHUB_ENV"
echo "$EOF" >> "$GITHUB_ENV"
- 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: FIXME
title: 'Release ${{ env.VERSION }}'
body: '${{ env.RELEASE_NOTES }}'
release-crate:
name: "Release Rust 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_TOKEN }}'
with:
command: publish
args: --registry luon
release-docker-image:
name: "Release Docker image"
runs-on: debian-latest
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Docker metadata
id: meta
uses: https://github.com/docker/metadata-action@v4
with:
images: |
git.luon.net/paul/solar-grabber
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v2
- name: Login to the Gitea Docker registry
uses: https://github.com/docker/login-action@v2
with:
registry: git.luon.net
username: ${{ github.repository_owner }}
# This needs to be provided by the repository owner and have the packages scopes enabled.
# Note that the default `GITEA_TOKEN` secret does not have this scope enabled.
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Docker build and push
uses: https://github.com/docker/build-push-action@v4
env:
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}

View File

@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.3.1]
### Changed
* Fix and improve Gitea Actions workflow
### Security
* Update dependencies ([RUSTSEC-2023-0044](https://rustsec.org/advisories/RUSTSEC-2023-0044))
## [0.3.0] - 2023-04-15
### Added
@ -81,7 +91,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Rename Autarco Scraper project to Solar Grabber.
[Unreleased]: https://git.luon.net/paul/solar-grabber/compare/v0.3.0...HEAD
[Unreleased]: https://git.luon.net/paul/solar-grabber/compare/v0.3.1...HEAD
[0.3.1]: https://git.luon.net/paul/solar-grabber/compare/v0.2.2...v0.3.0
[0.3.0]: https://git.luon.net/paul/solar-grabber/compare/v0.2.2...v0.3.0
[0.2.2]: https://git.luon.net/paul/solar-grabber/compare/v0.2.1...v0.2.2
[0.2.1]: https://git.luon.net/paul/solar-grabber/compare/v0.2.0...v0.2.1

945
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "solar-grabber"
version = "0.3.0"
version = "0.3.1"
authors = ["Paul van Tilburg <paul@luon.net>"]
edition = "2021"
description = """"

View File

@ -7,7 +7,6 @@
FROM docker.io/rust:1 as builder
# Build the dependencies first
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN USER=root cargo new --bin /usr/src/solar-grabber
WORKDIR /usr/src/solar-grabber
COPY ./Cargo.* ./

View File

@ -135,7 +135,7 @@ pub fn setup() -> Rocket<Build> {
.expect("Invalid configuration");
let service = services::get(config.service).expect("Invalid service");
// We don't care about the join handle nor error results?t
// We don't care about the join handle nor error results?
let _service = rocket::tokio::spawn(update_loop(service));
})
}))