Skip to content

Commit

Permalink
Corrected the doc in README and added release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbdz committed Mar 13, 2024
1 parent ff71f8d commit 88a5ac6
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 5 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
outputs:
app_name: ${{ steps.extract_repo_name.outputs.app_name }}
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Extract repository name
id: extract_repo_name
run: echo "::set-output name=app_name::$(echo ${GITHUB_REPOSITORY##*/})"

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22' # Adjust as needed

- name: Build for Linux
run: |
GOOS=linux GOARCH=amd64 go build -o ${{ steps.extract_repo_name.outputs.app_name }}-linux-amd64
tar czvf ${{ steps.extract_repo_name.outputs.app_name }}-linux-amd64.tar.gz ${{ steps.extract_repo_name.outputs.app_name }}-linux-amd64
- name: Build for Windows
run: |
GOOS=windows GOARCH=amd64 go build -o ${{ steps.extract_repo_name.outputs.app_name }}-windows-amd64.exe
tar czvf ${{ steps.extract_repo_name.outputs.app_name }}-windows-amd64.tar.gz ${{ steps.extract_repo_name.outputs.app_name }}-windows-amd64.exe
- name: Build for macOS
run: |
GOOS=darwin GOARCH=amd64 go build -o ${{ steps.extract_repo_name.outputs.app_name }}-darwin-amd64
tar czvf ${{ steps.extract_repo_name.outputs.app_name }}-darwin-amd64.tar.gz ${{ steps.extract_repo_name.outputs.app_name }}-darwin-amd64
- name: Generate Checksums
run: sha256sum *.tar.gz > SHA256-checksums.txt

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.extract_repo_name.outputs.app_name }}-linux-amd64.tar.gz
asset_name: ${{ steps.extract_repo_name.outputs.app_name }}-linux-amd64.tar.gz
asset_content_type: application/gzip
# Repeat for each artifact
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ sudo make uninstall
## How-to-Use
Help:
```bash
csv-viewer --help
-h, --help
-v, --view (column, table, json)
-c, --columns
Display CSV content in various formats: column, table, json.

Usage:
csv-viewer [filePath] [flags]

Flags:
-c, --columns string Select columns to display (e.g., --columns="1,3")
-h, --help help for csv-viewer
-v, --view string View mode: column, table, json (default "column")
```

### Column view
Expand Down Expand Up @@ -45,7 +50,13 @@ csv-viewer --view table ./test/test.csv

Result:
```
+-----+--------------------------------+-----------+
| AAA | Description with a comma, and | More text |
| | a quote "like this" | |
+-----+--------------------------------+-----------+
| BBB | Another description, with a | More text |
| | newline like this | |
+-----+--------------------------------+-----------+
```

### JSON view
Expand Down

0 comments on commit 88a5ac6

Please sign in to comment.