Skip to content

Commit 2cbcbc3

Browse files
authored
Merge pull request #12 from anIcedAntFA/test/lfs-migration
Test/lfs migration
2 parents 42c45a0 + 49b503a commit 2cbcbc3

File tree

12 files changed

+734
-136
lines changed

12 files changed

+734
-136
lines changed

.gitattributes

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,88 @@
1-
# Git attributes for demo files
2-
# Note: GIF files are stored as regular git files, not using LFS
1+
# =============================================================================
2+
# Git Attributes Configuration for gohome
3+
# =============================================================================
4+
# This file defines how Git handles different file types in this repository.
5+
#
6+
# Git LFS (Large File Storage) is used for binary media files to keep the
7+
# repository lightweight. LFS stores pointers in Git history while actual
8+
# files are stored separately on GitHub's LFS servers.
9+
#
10+
# Migration History:
11+
# - Initial: GIFs stored as regular Git files (commits 7097c03-28f9223)
12+
# - v1.2.0: Migrated to Git LFS for scalability (this commit)
13+
# =============================================================================
14+
15+
# -----------------------------------------------------------------------------
16+
# Text files - Line ending normalization
17+
# -----------------------------------------------------------------------------
18+
# Ensure consistent LF line endings across platforms
19+
*.go text eol=lf
20+
*.md text eol=lf
21+
*.yml text eol=lf
22+
*.yaml text eol=lf
23+
*.json text eol=lf
24+
*.sh text eol=lf
25+
*.ps1 text eol=crlf
26+
*.tape text eol=lf
27+
*.cast text eol=lf
28+
29+
# -----------------------------------------------------------------------------
30+
# Media files - Git LFS tracking
31+
# -----------------------------------------------------------------------------
32+
# Demo GIFs and images for README examples
33+
# These files are stored in Git LFS to avoid bloating the repository
34+
docs/demos/*.gif filter=lfs diff=lfs merge=lfs -text
35+
docs/demos/*.png filter=lfs diff=lfs merge=lfs -text
36+
docs/demos/*.mp4 filter=lfs diff=lfs merge=lfs -text
37+
docs/demos/*.webm filter=lfs diff=lfs merge=lfs -text
38+
39+
# Asciinema cast files: Don't show diffs (large JSON recordings)
340
docs/demos/*.cast -diff
41+
42+
# VHS tape files: Syntax highlight as Elixir (similar to VHS project)
43+
*.tape linguist-language=elixir
44+
45+
# -----------------------------------------------------------------------------
46+
# Binary executables
47+
# -----------------------------------------------------------------------------
48+
*.exe binary
49+
*.dll binary
50+
*.so binary
51+
*.dylib binary
52+
*.a binary
53+
54+
# -----------------------------------------------------------------------------
55+
# Compressed archives
56+
# -----------------------------------------------------------------------------
57+
*.zip binary
58+
*.tar.gz binary
59+
*.tgz binary
60+
*.rar binary
61+
*.7z binary
62+
63+
# -----------------------------------------------------------------------------
64+
# Go specific
65+
# -----------------------------------------------------------------------------
66+
# Go module files should always use LF
67+
go.mod text eol=lf
68+
go.sum text eol=lf
69+
70+
# Generated Go files
71+
*.pb.go linguist-generated
72+
*_gen.go linguist-generated
73+
74+
# -----------------------------------------------------------------------------
75+
# Documentation and generated files
76+
# -----------------------------------------------------------------------------
77+
# Linguist overrides for GitHub language statistics
78+
vendor/* linguist-vendored
79+
node_modules/* linguist-vendored
80+
81+
# -----------------------------------------------------------------------------
82+
# Export and diff settings
83+
# -----------------------------------------------------------------------------
84+
# Exclude files from git archive
85+
.github export-ignore
86+
.gitignore export-ignore
87+
.gitattributes export-ignore
88+
.golangci.yml export-ignore

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Automated via GoReleaser:
8181
2. Push: `git push origin v1.x.x`
8282
3. GitHub Actions triggers cross-platform builds (Linux/Windows/macOS amd64/arm64)
8383

84-
See [RELEASE_GUIDE.md](RELEASE_GUIDE.md) and [.github/workflows/release.yml](.github/workflows/release.yml)
84+
See [docs/RELEASE_GUIDE.md](../docs/RELEASE_GUIDE.md) and [.github/workflows/release.yml](.github/workflows/release.yml)
8585

8686
## Code Conventions
8787

.github/workflows/build.yml

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
1-
name: Build
2-
3-
on:
4-
push:
5-
branches: [ main, develop ]
6-
pull_request:
7-
branches: [ main, develop ]
8-
9-
jobs:
10-
build:
11-
name: Build Binary
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
os: [ubuntu-latest, macos-latest, windows-latest]
16-
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v4
19-
20-
- name: Set up Go
21-
uses: actions/setup-go@v5
22-
with:
23-
go-version: '1.21'
24-
25-
- name: Build
26-
shell: bash
27-
run: |
28-
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
29-
COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "none")
30-
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
31-
go build -v -ldflags "-X github.com/anIcedAntFA/gohome/internal/version.Version=$VERSION -X github.com/anIcedAntFA/gohome/internal/version.Commit=$COMMIT -X github.com/anIcedAntFA/gohome/internal/version.Date=$BUILD_DATE" ./cmd/gohome
32-
33-
- name: Upload artifact
34-
uses: actions/upload-artifact@v4
35-
with:
36-
name: gohome-${{ matrix.os }}
37-
path: gohome*
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
build:
11+
name: Build Binary
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
lfs: true # Fetch LFS files if needed
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.21'
26+
27+
- name: Build
28+
shell: bash
29+
run: |
30+
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
31+
COMMIT=$(git rev-parse --short HEAD 2>/dev/null || echo "none")
32+
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
33+
go build -v -ldflags "-X github.com/anIcedAntFA/gohome/internal/version.Version=$VERSION -X github.com/anIcedAntFA/gohome/internal/version.Commit=$COMMIT -X github.com/anIcedAntFA/gohome/internal/version.Date=$BUILD_DATE" ./cmd/gohome
34+
35+
- name: Upload artifact
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: gohome-${{ matrix.os }}
39+
path: gohome*

.github/workflows/release.yml

Lines changed: 92 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,92 @@
1-
name: Release
2-
3-
on:
4-
push:
5-
tags:
6-
- 'v*.*.*'
7-
8-
permissions:
9-
contents: write
10-
packages: write
11-
id-token: write
12-
13-
jobs:
14-
release:
15-
name: Release
16-
runs-on: ubuntu-latest
17-
18-
steps:
19-
- name: Checkout code
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Setup Go
25-
uses: actions/setup-go@v5
26-
with:
27-
go-version: '1.23'
28-
cache: true
29-
30-
- name: Install cross-compilation toolchains
31-
run: |
32-
sudo apt-get update
33-
sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-aarch64-linux-gnu
34-
35-
- name: Run tests
36-
run: |
37-
go test -v -coverprofile=coverage.txt ./...
38-
mkdir -p /tmp/coverage
39-
mv coverage.txt /tmp/coverage/ || true
40-
41-
- name: Run GoReleaser
42-
uses: goreleaser/goreleaser-action@v6
43-
with:
44-
distribution: goreleaser
45-
version: '~> v2'
46-
args: release --clean
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
50-
51-
- name: Upload coverage to Codecov
52-
uses: codecov/codecov-action@v3
53-
with:
54-
files: /tmp/coverage/coverage.txt
55-
56-
publish-npm:
57-
name: Publish to NPM
58-
runs-on: ubuntu-latest
59-
needs: release
60-
permissions:
61-
contents: read
62-
id-token: write # Required for npm OIDC trusted publishing
63-
64-
steps:
65-
- name: Checkout code
66-
uses: actions/checkout@v4
67-
68-
- name: Setup Node.js
69-
uses: actions/setup-node@v4
70-
with:
71-
node-version: '22'
72-
registry-url: 'https://registry.npmjs.org'
73-
74-
- name: Update npm for OIDC trusted publishing
75-
run: npm install -g npm@latest # Requires npm >= 11.5.1
76-
77-
- name: Extract version from tag
78-
id: get_version
79-
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
80-
81-
- name: Update package.json version
82-
run: |
83-
cd npm-package
84-
npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version --allow-same-version
85-
86-
- name: Publish to NPM
87-
run: |
88-
cd npm-package
89-
npm publish --access public
90-
# Uses OIDC trusted publishing - no token needed
91-
# Provenance attestations are automatic with trusted publishing
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
id-token: write
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0 # Full history for changelog
23+
lfs: true # Fetch LFS files (demo GIFs)
24+
25+
- name: Setup Go
26+
uses: actions/setup-go@v5
27+
with:
28+
go-version: '1.23'
29+
cache: true
30+
31+
- name: Install cross-compilation toolchains
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-aarch64-linux-gnu
35+
36+
- name: Run tests
37+
run: |
38+
go test -v -coverprofile=coverage.txt ./...
39+
mkdir -p /tmp/coverage
40+
mv coverage.txt /tmp/coverage/ || true
41+
42+
- name: Run GoReleaser
43+
uses: goreleaser/goreleaser-action@v6
44+
with:
45+
distribution: goreleaser
46+
version: '~> v2'
47+
args: release --clean
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
51+
52+
- name: Upload coverage to Codecov
53+
uses: codecov/codecov-action@v3
54+
with:
55+
files: /tmp/coverage/coverage.txt
56+
57+
publish-npm:
58+
name: Publish to NPM
59+
runs-on: ubuntu-latest
60+
needs: release
61+
permissions:
62+
contents: read
63+
id-token: write # Required for npm OIDC trusted publishing
64+
65+
steps:
66+
- name: Checkout code
67+
uses: actions/checkout@v4
68+
69+
- name: Setup Node.js
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: '22'
73+
registry-url: 'https://registry.npmjs.org'
74+
75+
- name: Update npm for OIDC trusted publishing
76+
run: npm install -g npm@latest # Requires npm >= 11.5.1
77+
78+
- name: Extract version from tag
79+
id: get_version
80+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
81+
82+
- name: Update package.json version
83+
run: |
84+
cd npm-package
85+
npm version ${{ steps.get_version.outputs.VERSION }} --no-git-tag-version --allow-same-version
86+
87+
- name: Publish to NPM
88+
run: |
89+
cd npm-package
90+
npm publish --access public
91+
# Uses OIDC trusted publishing - no token needed
92+
# Provenance attestations are automatic with trusted publishing

0 commit comments

Comments
 (0)