Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📢 publish via github actions and maintenance by oct 2024 #43

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
📢 publish via github actions and maintenance by oct 2024
gerardcl committed Oct 3, 2024
commit 7cd2714ed90aa0b677df790056355facb93acbc6
21 changes: 19 additions & 2 deletions .github/workflows/CICD.yaml
Original file line number Diff line number Diff line change
@@ -59,7 +59,6 @@ jobs:
matrix:
rust:
- stable
- 1.74.0
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
@@ -80,7 +79,6 @@ jobs:
matrix:
rust:
- stable
- 1.74.0
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
@@ -141,3 +139,22 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/rodalies-cli*

release:
name: Publish (crates.io)
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Login
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo login
- name: Publish
run: cargo publish
145 changes: 80 additions & 65 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rodalies-cli"
version = "1.2.3"
version = "1.2.4"
edition = "2021"
authors = ["Gerard C.L. <gerardcl@gmail.com>"]
license = "BSD-3-Clause"
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ After a release a github action updates it with x86_64 built binaries for:
Run the following command to get the binary into your bin folder or tune it as you like:

```bash
curl -LO "https://github.com/gerardcl/rodalies-cli/releases/download/1.2.3/rodalies-cli-linux-amd64" && \
curl -LO "https://github.com/gerardcl/rodalies-cli/releases/download/1.2.4/rodalies-cli-linux-amd64" && \
chmod +x rodalies-cli-linux-amd64 && mv rodalies-cli-linux-amd64 /usr/local/bin/rodalies-cli
```

@@ -28,7 +28,7 @@ chmod +x rodalies-cli-linux-amd64 && mv rodalies-cli-linux-amd64 /usr/local/bin/
Run the following command to get the binary into your bin folder or tune it as you like:

```bash
curl -LO "https://github.com/gerardcl/rodalies-cli/releases/download/1.2.3/rodalies-cli-darwin-amd64" && \
curl -LO "https://github.com/gerardcl/rodalies-cli/releases/download/1.2.4/rodalies-cli-darwin-amd64" && \
chmod +x rodalies-cli-darwin-amd64 && mv rodalies-cli-darwin-amd64 /usr/local/bin/rodalies-cli
```

@@ -39,7 +39,7 @@ chmod +x rodalies-cli-darwin-amd64 && mv rodalies-cli-darwin-amd64 /usr/local/bi
Run the following command to get the binary into your bin folder or tune it as you like:

```bash
curl -LO "https://github.com/gerardcl/rodalies-cli/releases/download/1.2.3/rodalies-cli-windows-amd64.exe" && \
curl -LO "https://github.com/gerardcl/rodalies-cli/releases/download/1.2.4/rodalies-cli-windows-amd64.exe" && \
chmod +x rodalies-cli-windows-amd64.exe && mv rodalies-cli-windows-amd64.exe /mingw64/bin/rodalies-cli.exe
```

@@ -131,7 +131,7 @@ $ rodalies-cli -d 9 -m 9
```bash
$ rodalies-cli -s gir
🚂 Rodalies CLI 📅 Today's date is 02/08/2022
✅ You are running the latest rodalies-cli, version 1.2.3! yayy
✅ You are running the latest rodalies-cli, version 1.2.4! yayy
✨ Interactive mode enabled: 'false'
🔍 Searching stations that contain the text: 'gir'
+--------------+------------+
@@ -142,7 +142,7 @@ $ rodalies-cli -s gir
$ rodalies-cli -s si
🚂 Rodalies CLI 📅 Today's date is 02/08/2022
✅ You are running the latest rodalies-cli, version 1.2.3! yayy
✅ You are running the latest rodalies-cli, version 1.2.4! yayy
✨ Interactive mode enabled: 'false'
🔍 Searching stations that contain the text: 'si'
+------------------------+------------+
@@ -159,7 +159,7 @@ $ rodalies-cli -s si
```bash
$ rodalies-cli -f 79300 -t 79202
🚂 Rodalies CLI 📅 Today's date is 02/08/2022
✅ You are running the latest rodalies-cli, version 1.2.3! yayy
✅ You are running the latest rodalies-cli, version 1.2.4! yayy
✨ Interactive mode enabled: 'false'
🔍 Searching timetable for date 02/08/2022
📆 Listing timetable with 0 transfers
@@ -208,7 +208,7 @@ If the timetable requires a transfer you will also see it:
```bash
$ rodalies-cli -f 79300 -t 71701
🚂 Rodalies CLI 📅 Today's date is 02/08/2022
✅ You are running the latest rodalies-cli, version 1.2.3! yayy
✅ You are running the latest rodalies-cli, version 1.2.4! yayy
✨ Interactive mode enabled: 'false'
🔍 Searching timetable for date 02/08/2022
📆 Listing timetable with 1 transfers
@@ -249,7 +249,7 @@ $ rodalies-cli -f 79300 -t 71701
```bash
$ rodalies-cli -f 79300 -t 72503
🚂 Rodalies CLI 📅 Today's date is 02/08/2022
✅ You are running the latest rodalies-cli, version 1.2.3! yayy
✅ You are running the latest rodalies-cli, version 1.2.4! yayy
✨ Interactive mode enabled: 'false'
🔍 Searching timetable for date 02/08/2022
📆 Listing timetable with 2 transfers
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use chrono::{Datelike, Local};
use std::error::Error;

use chrono::{Datelike, Local};
use rodalies_cli::config::check::check_rodalies_version;
use rodalies_cli::config::cli::{init_cli, interactive_mode};
use rodalies_cli::rodalies::client::init_client;
4 changes: 2 additions & 2 deletions src/rodalies/station.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ use crate::{
};

/// The Station information struct
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct Station {
/// The internal ID of the station name, that is provided by the rodalies site. It is the value used when submitting a search.
pub id: String,
@@ -22,7 +22,7 @@ pub struct Station {
pub async fn get_stations_list(client: &Client) -> Result<Vec<Station>, Box<dyn Error>> {
let parsed_html = get_search_page(client).await?;

let selector = &Selector::parse(r#"#origen > option"#).unwrap();
let selector = &Selector::parse(r#"#origen > option"#)?;

let station_id: Vec<&str> = parsed_html
.select(selector)
2 changes: 1 addition & 1 deletion src/rodalies/timetable.rs
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ pub async fn search_timetable_input(
let parsed_html = get_timetable_page(client, from, to, date).await?;

// check, show and fail if displayed errors
let selector_errors = &Selector::parse(r#".error_contingut > p"#).unwrap();
let selector_errors = &Selector::parse(r#".error_contingut > p"#)?;
let errors: Vec<&str> = parsed_html
.select(selector_errors)
.flat_map(|el| el.text())