diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 54a690f..27852f1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: build +name: Build on: push: @@ -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 \ No newline at end of file + 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 + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..538da16 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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" + diff --git a/Cargo.toml b/Cargo.toml index 3b0f327..0eb6b20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] @@ -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" \ No newline at end of file diff --git a/NOTES.md b/NOTES.md new file mode 100644 index 0000000..1702fdd --- /dev/null +++ b/NOTES.md @@ -0,0 +1,5 @@ +# Notes + +## v0.1.0 + +Initial version.