Add package yaml

This commit is contained in:
Love 2025-01-09 16:31:33 +01:00
parent 0919a189cf
commit f971f3ba81
4 changed files with 59 additions and 8 deletions

51
.github/workflows/package.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Build Packages
on:
push:
tags:
- "v*" # Triggers on tags starting with 'v'
permissions:
contents: write # Needed for creating releases
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install packaging tools
run: |
cargo install cargo-deb
cargo install cargo-generate-rpm
- name: Build Debian package
run: cargo deb
- id: get_tag_info
name: Get Tag Info
run: |
tag="${GITHUB_REF##*/}"
echo "Found tag: $tag"
message=$(git tag -l --format='%(contents)' "$tag")
# Set outputs using the recommended environment files approach
echo "tag=$tag" >> $GITHUB_OUTPUT
echo "message=$message" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.get_tag_info.outputs.tag }}
name: Release ${{ steps.get_tag_info.outputs.tag }}
body: ${{ steps.get_tag_info.outputs.message }}
artifacts: |
target/debian/*.deb
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true

2
Cargo.lock generated
View File

@ -252,7 +252,7 @@ dependencies = [
[[package]] [[package]]
name = "ecb-rates" name = "ecb-rates"
version = "0.1.0" version = "1.0.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",

View File

@ -1,7 +1,7 @@
[package] [package]
name = "ecb-rates" name = "ecb-rates"
description = "Query exchange rates from the European Central Bank (ECB)" description = "Query exchange rates from the European Central Bank (ECB)"
version = "0.1.0" version = "1.0.0"
edition = "2021" edition = "2021"
authors = ["Love Billenius <lovebillenius@disroot.org>"] authors = ["Love Billenius <lovebillenius@disroot.org>"]
license-file = "LICENSE" license-file = "LICENSE"

View File

@ -7,7 +7,7 @@
alt="European Central Bank Logo" alt="European Central Bank Logo"
align="left" align="left"
/> />
A CLI utility to fetch the currency rates against the Euro from the ECB. A CLI utility to fetch exchange reates from the European Central Bank.
<br /> <br />
<br /> <br />
<br /> <br />
@ -63,23 +63,23 @@ It wouldn't be a rust project without being *BLAZINGLY FAST*! When the cache is
#### Show the original data from ECB #### Show the original data from ECB
![eur-to-all](screenshots/eur-to-all.png) ![eur-to-all](images/eur-to-all.png)
#### ...with only select currencies #### ...with only select currencies
![eur-to-all](screenshots/eur-to-all-select.png) ![eur-to-all](images/eur-to-all-select.png)
#### Put the exchange rate in the perspective of any currency #### Put the exchange rate in the perspective of any currency
![usd-to-all](screenshots/usd-to-all.png) ![usd-to-all](images/usd-to-all.png)
#### Flip it #### Flip it
![all-to-usd](screenshots/all-to-usd.png) ![all-to-usd](images/all-to-usd.png)
#### Show multiple days #### Show multiple days
![eur-to-all-multiple-days](screenshots/eur-to-all-multiple-days.png) ![eur-to-all-multiple-days](images/eur-to-all-multiple-days.png)
## Acknowledgment ## Acknowledgment