diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml deleted file mode 100644 index 8daf837..0000000 --- a/.forgejo/workflows/release.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Release - -on: - push: - tags: - - 'v*' - workflow_dispatch: - -jobs: - release: - name: Build and Release - runs-on: nix - - steps: - - name: Check out Repository - uses: https://git.konstantinfickel.de/actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - - - name: Extract version and handle tagging - id: version - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - # Manual trigger: read version from Cargo.toml - VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') - TAG="v${VERSION}" - - # Check if tag already exists - if git rev-parse "$TAG" >/dev/null 2>&1; then - echo "::error::Version ${VERSION} is already released" - exit 1 - fi - - # Create and push the tag - git tag "$TAG" - git push origin "$TAG" - - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - echo "TAG=${TAG}" >> $GITHUB_OUTPUT - else - # Tag push trigger: extract version from tag - VERSION="${GITHUB_REF_NAME#v}" - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - echo "TAG=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT - fi - - - name: Build .deb package - run: nix build .#streamd-deb -o result-deb - - - name: Build static binary - run: nix build .#streamd-musl -o result-musl - - - name: Prepare release artifacts - run: | - mkdir -p release - cp result-deb release/streamd_${{ steps.version.outputs.VERSION }}_amd64.deb - cp result-musl/bin/streamd release/streamd-${{ steps.version.outputs.VERSION }}-linux-x86_64 - - - name: Create release - uses: https://code.forgejo.org/actions/forgejo-release@v2 - with: - direction: upload - url: https://git.konstantinfickel.de - repo: kfickel/streamd - token: ${{ secrets.RELEASE_TOKEN }} - tag: ${{ steps.version.outputs.TAG }} - release-dir: release - release-notes: | - ## streamd ${{ steps.version.outputs.VERSION }} - - ### Debian/Ubuntu - ```bash - wget /streamd_${{ steps.version.outputs.VERSION }}_amd64.deb - sudo dpkg -i streamd_${{ steps.version.outputs.VERSION }}_amd64.deb - ``` - - ### Static binary - ```bash - wget /streamd-${{ steps.version.outputs.VERSION }}-linux-x86_64 - chmod +x streamd-*-linux-x86_64 - sudo mv streamd-*-linux-x86_64 /usr/local/bin/streamd - ``` diff --git a/README.md b/README.md index a738339..1ee95a9 100644 --- a/README.md +++ b/README.md @@ -4,39 +4,6 @@ Strea.md is a personal knowledge management and time-tracking CLI tool. It organizes time-ordered markdown files using `@tag` annotations, letting you manage tasks, track time, and query your notes from the terminal. -## Installation - -### Debian/Ubuntu (.deb package) - -Download and install the latest release: - -```bash -wget https://git.konstantinfickel.de/kfickel/streamd/releases/download/vX.Y.Z/streamd_X.Y.Z_amd64.deb -sudo dpkg -i streamd_X.Y.Z_amd64.deb -``` - -This includes shell completions for bash, zsh, and fish. - -### Static Binary - -Download the statically-linked binary: - -```bash -wget https://git.konstantinfickel.de/kfickel/streamd/releases/download/vX.Y.Z/streamd-X.Y.Z-linux-x86_64 -chmod +x streamd-X.Y.Z-linux-x86_64 -sudo mv streamd-X.Y.Z-linux-x86_64 /usr/local/bin/streamd -``` - -### Nix - -Using the flake directly: - -```bash -nix run git+https://git.konstantinfickel.de/kfickel/streamd -``` - -Or add to your NixOS/Home Manager configuration using the provided `homeManagerModules.default`. - ## Core Concepts - **Shards** — Sections of markdown files, organized hierarchically by headings. Each shard can contain markers, tags, and nested child shards. diff --git a/flake.nix b/flake.nix index 38723ae..d0c3479 100644 --- a/flake.nix +++ b/flake.nix @@ -30,9 +30,6 @@ inherit (nixpkgs) lib; forAllSystems = lib.genAttrs lib.systems.flakeExposed; - # Read version from Cargo.toml as single source of truth - version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version; - mkPkgs = system: import nixpkgs { @@ -61,7 +58,7 @@ commonArgs = { src = craneLib.path ./.; pname = "streamd"; - inherit version; + version = "0.1.0"; strictDeps = true; }; @@ -105,85 +102,15 @@ commitizen.enable = true; }; }; - - mkMuslCraneLib = - system: - let - pkgs = mkPkgs system; - toolchain = pkgs.rust-bin.stable.latest.default.override { - targets = [ "x86_64-unknown-linux-musl" ]; - }; - in - (crane.mkLib pkgs).overrideToolchain toolchain; - - mkStreamdMusl = - system: - let - craneLib = mkMuslCraneLib system; - commonArgs = { - src = craneLib.path ./.; - pname = "streamd"; - inherit version; - strictDeps = true; - CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl"; - CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static"; - }; - cargoArtifacts = craneLib.buildDepsOnly commonArgs; - in - craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; }); - - mkStreamdDeb = - system: - let - pkgs = mkPkgs system; - streamd-musl = mkStreamdMusl system; - in - pkgs.runCommand "streamd_${version}_amd64.deb" { - nativeBuildInputs = [ pkgs.nfpm ]; - } '' - # Generate shell completions - mkdir -p completions - ${streamd-musl}/bin/streamd completions bash > completions/streamd.bash - ${streamd-musl}/bin/streamd completions zsh > completions/_streamd - ${streamd-musl}/bin/streamd completions fish > completions/streamd.fish - - cat > nfpm.yaml <