irongit

The dotfiles manager.

doc: add image and use cases

huncholanehuncholaneauthored
parent caf0f5ccommit 34ed504207290f71d0bf0757dcc22b007fdd3c5bBrowse files

3 files changed, +131 -5

+118-0.github/workflows/release.yml
@@ -0,0 +1,118 @@
1+name: Build and Release
2+
3+on:
4+ push:
5+ tags:
6+ - "v*"
7+ workflow_dispatch:
8+
9+permissions:
10+ contents: write
11+
12+jobs:
13+ build:
14+ name: Build (${{ matrix.os }} • ${{ matrix.target }})
15+ runs-on: ${{ matrix.os }}
16+ strategy:
17+ fail-fast: false
18+ matrix:
19+ include:
20+ - os: ubuntu-latest
21+ target: x86_64-unknown-linux-gnu
22+ use_cross: true
23+ - os: ubuntu-latest
24+ target: aarch64-unknown-linux-gnu
25+ use_cross: true
26+ - os: macos-14
27+ target: aarch64-apple-darwin
28+ use_cross: false
29+ - os: windows-latest
30+ target: x86_64-pc-windows-msvc
31+ use_cross: false
32+
33+ steps:
34+ - name: Checkout
35+ uses: actions/checkout@v4
36+
37+ - name: Install Rust toolchain
38+ uses: dtolnay/rust-toolchain@stable
39+ with:
40+ targets: ${{ matrix.target }}
41+
42+ - name: Cache cargo
43+ uses: Swatinem/rust-cache@v2
44+ with:
45+ save-if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }}
46+
47+ - name: Install cross (Linux targets)
48+ if: matrix.use_cross == true
49+ uses: taiki-e/install-action@v2
50+ with:
51+ tool: cross
52+
53+ - name: Build release
54+ shell: bash
55+ run: |
56+ set -euo pipefail
57+ if [[ "${{ matrix.use_cross }}" == "true" ]]; then
58+ cross build --release --target "${{ matrix.target }}"
59+ else
60+ cargo build --release --target "${{ matrix.target }}"
61+ fi
62+
63+ - name: Prepare artifacts (Unix)
64+ id: prep
65+ if: runner.os != 'Windows'
66+ shell: bash
67+ run: |
68+ set -euo pipefail
69+ mkdir -p dist
70+ BIN="dothub"
71+ EXT=""
72+ SRC="target/${{ matrix.target }}/release/${BIN}${EXT}"
73+ if [[ ! -f "$SRC" ]]; then
74+ echo "Binary not found at $SRC" >&2
75+ exit 1
76+ fi
77+ OUT_BASENAME="${BIN}-${{ matrix.target }}"
78+ cp "$SRC" "dist/${OUT_BASENAME}${EXT}"
79+ (cd dist && tar -czf "${OUT_BASENAME}.tar.gz" "${OUT_BASENAME}${EXT}")
80+ echo "archive=dist/${OUT_BASENAME}.tar.gz" >> "$GITHUB_OUTPUT"
81+ echo "binary=dist/${OUT_BASENAME}${EXT}" >> "$GITHUB_OUTPUT"
82+
83+ - name: Prepare artifacts (Windows)
84+ id: prep_win
85+ if: runner.os == 'Windows'
86+ shell: pwsh
87+ run: |
88+ $ErrorActionPreference = 'Stop'
89+ New-Item -ItemType Directory -Force -Path dist | Out-Null
90+ $Bin = 'dothub'
91+ $Ext = '.exe'
92+ $Src = "target/${{ matrix.target }}/release/${Bin}${Ext}"
93+ if (!(Test-Path $Src)) { Write-Error "Binary not found at $Src" }
94+ $OutBase = "$Bin-${{ matrix.target }}"
95+ Copy-Item $Src "dist/${OutBase}${Ext}"
96+ Compress-Archive -Path "dist/${OutBase}${Ext}" -DestinationPath "dist/${OutBase}.zip" -Force
97+ "archive=dist/${OutBase}.zip" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
98+ "binary=dist/${OutBase}${Ext}" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
99+
100+ - name: Upload build artifacts
101+ uses: actions/upload-artifact@v4
102+ with:
103+ name: ${{ matrix.os }}-${{ matrix.target }}
104+ path: |
105+ dist/*
106+
107+ - name: Release on tag
108+ if: github.ref_type == 'tag'
109+ uses: softprops/action-gh-release@v2
110+ with:
111+ files: |
112+ ${{ steps.prep.outputs.archive }}
113+ ${{ steps.prep.outputs.binary }}
114+ ${{ steps.prep_win.outputs.archive }}
115+ ${{ steps.prep_win.outputs.binary }}
116+ generate_release_notes: true
117+ env:
118+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+13-5README.md
@@ -8,7 +8,16 @@
88 </h4>
99 <hr>
1010
11-A community driven dotfile management platform. This is a golden opportunity for beginners and experts alike to make contributions to the beloved opensource community. Contributing can be as simple as adding your dotfiles to the hub.yml. Help is also wanted to solve issues and create features.
11+A community driven dotfile management platform. This is a golden opportunity for
12+beginners and experts alike to make contributions to the open source community.
13+Contributing can be as simple as adding your dotfiles to the hub.yml.
14+Help is also wanted to solve issues and create features.
15+
16+## Use Cases
17+
18+- Switch in and out of dotfiles with one command
19+- [Share](./hub.yml) your dotfiles with other dothub users
20+- Effortlessly try out new dotfiles
1221
1322 ## Installation
1423
@@ -20,15 +29,14 @@ rustup update
2029 ```
2130 - Make sure the cargo binary directory is in your PATH
2231
32+```bash
33+export PATH=$PATH:~/.cargo/bin
34+```
2335 **Note:** You can configure root to use your default profile's cargo binaries too.
2436 ```bash
2537 # .zshrc|.bashrc|etc
2638 export PATH=$PATH:/home/<my_user>/.cargo/bin
2739 ```
28-Or simply
29-```bash
30-export PATH=$PATH:~/.cargo/bin
31-```
3240
3341 ### Cargo Install
3442
+0-0doc/base-command.png

Binary file changed.