From f971f3ba8136d96a0e26d07eab29b786feca69ef Mon Sep 17 00:00:00 2001 From: Love Billenius Date: Thu, 9 Jan 2025 16:31:33 +0100 Subject: [PATCH] Add package yaml --- .github/workflows/package.yml | 51 +++++++++++++++++++++++++++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 12 ++++----- 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/package.yml diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..b4a8356 --- /dev/null +++ b/.github/workflows/package.yml @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 1b827b1..69bc98b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "ecb-rates" -version = "0.1.0" +version = "1.0.0" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index edf4465..31e5524 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ecb-rates" description = "Query exchange rates from the European Central Bank (ECB)" -version = "0.1.0" +version = "1.0.0" edition = "2021" authors = ["Love Billenius "] license-file = "LICENSE" diff --git a/README.md b/README.md index 33b2ba6..dce8abe 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ alt="European Central Bank Logo" 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.


@@ -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 -![eur-to-all](screenshots/eur-to-all.png) +![eur-to-all](images/eur-to-all.png) #### ...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 -![usd-to-all](screenshots/usd-to-all.png) +![usd-to-all](images/usd-to-all.png) #### Flip it -![all-to-usd](screenshots/all-to-usd.png) +![all-to-usd](images/all-to-usd.png) #### 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