Skip to content
Merged
Show file tree
Hide file tree
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
30 changes: 25 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build

on:
push:
Expand All @@ -11,14 +11,34 @@ env:

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup cargo
run: cargo install cargo-deb

- name: Build
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose

- name: Run clippy
run: cargo clippy --verbose
run: cargo clippy --verbose

- name: Create debian package
run: cargo deb

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: fetch-${{ matrix.platform }}.deb
path: target/debian/fetch_*_amd64.deb

72 changes: 72 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
push:
tags: [ "v*" ]

env:
CARGO_TERM_COLOR: always

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--notes-file=NOTES.md \
--generate-notes \
--latest \
--verify-tag

build:
needs: release
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-20.04, ubuntu-22.04, ubuntu-24.04 ]
runs-on: ${{ matrix.platform }}
permissions:
contents: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup cargo
run: cargo install cargo-deb

- name: Build
run: cargo build

- name: Run tests
run: cargo test

- name: Run clippy
run: cargo clippy

- name: Create debian package
run: cargo deb

- name: Upload artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
mv target/debian/fetch_*_amd64.deb "fetch_${tag#v}-${{ matrix.platform }}_amd64.deb"
sha256sum "fetch_${tag#v}-${{ matrix.platform }}_amd64.deb" > "fetch_${tag#v}-${{ matrix.platform }}_amd64.deb.sha256"
gh release upload "${tag}" \
"fetch_${tag#v}-${{ matrix.platform }}_amd64.deb" \
"fetch_${tag#v}-${{ matrix.platform }}_amd64.deb.sha256"

13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[package]
name = "fetch"
description = "Command line tool to download and verify files"
keywords = ["download", "checksum", "sha256", "md5", "cli"]
categories = ["command-line-utilities"]
readme = "README.md"
homepage = "https://github.com/falk-werner/fetch"
repository = "https://github.com/falk-werner/fetch"
version = "0.1.0"
authors = ["Falk Werner"]
license = "MIT"
license-file = "LICENSE"
edition = "2021"

[dependencies]
Expand All @@ -12,3 +21,7 @@ reqwest = { version = "0.12.12", features = ["multipart", "stream"] }
sha2 = "0.10.8"
tempfile = "3.15.0"
tokio = { version = "1.43.0", features = ["macros", "rt", "rt-multi-thread"] }

[package.metadata.deb]
maintainer = "Falk Werner"
copyright = "2025, Falk Werner"
5 changes: 5 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Notes

## v0.1.0

Initial version.
Loading