Compare commits
14 Commits
Author | SHA1 | Date |
---|---|---|
Paul van Tilburg | 3fed86d36f | |
Paul van Tilburg | d3cc19524b | |
Paul van Tilburg | 92c75d09b9 | |
Paul van Tilburg | e1319dcfc2 | |
Paul van Tilburg | 0f1bc9d83d | |
Paul van Tilburg | 0068f6e9de | |
Paul van Tilburg | caad71389b | |
Paul van Tilburg | 0b76db96f0 | |
Paul van Tilburg | 42a43cc83d | |
Paul van Tilburg | 1aca61d3fd | |
Paul van Tilburg | 35dda781a3 | |
Paul van Tilburg | 14bda61a9e | |
Paul van Tilburg | bc22fd2d70 | |
Paul van Tilburg | fd00ef0b4f |
|
@ -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,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 }}
|
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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 = """"
|
||||
|
|
|
@ -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.* ./
|
||||
|
|
|
@ -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));
|
||||
})
|
||||
}))
|
||||
|
|
Loading…
Reference in New Issue