Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: abhimanyu003/sttr
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.17
Choose a base ref
...
head repository: abhimanyu003/sttr
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 1,702 additions and 935 deletions.
  1. +5 −6 .github/workflows/go.yml
  2. +49 −7 .github/workflows/goreleaser.yml
  3. +3 −0 .goreleaser.Dockerfile
  4. +158 −24 .goreleaser.yml
  5. +82 −44 README.md
  6. +3 −6 cmd/generate.go
  7. 0 cmd/{interacive.go → interactive.go}
  8. +3 −6 cmd/processor_ascii85-decode.go
  9. +3 −6 cmd/processor_ascii85-encode.go
  10. +3 −6 cmd/processor_base32-decode.go
  11. +3 −6 cmd/processor_base32-encode.go
  12. +4 −7 cmd/processor_base64-decode.go
  13. +3 −6 cmd/processor_base64-encode.go
  14. +4 −7 cmd/processor_base64url-decode.go
  15. +3 −6 cmd/processor_base64url-encode.go
  16. +4 −7 cmd/processor_bcrypt.go
  17. +4 −7 cmd/processor_camel.go
  18. +3 −6 cmd/processor_count-chars.go
  19. +3 −6 cmd/processor_count-lines.go
  20. +3 −6 cmd/processor_count-words.go
  21. +62 −0 cmd/processor_escape-quotes.go
  22. +3 −6 cmd/processor_extract-emails.go
  23. +3 −6 cmd/processor_extract-ip.go
  24. +53 −0 cmd/processor_extract-url.go
  25. +3 −6 cmd/processor_hex-decode.go
  26. +3 −6 cmd/processor_hex-encode.go
  27. +3 −6 cmd/processor_hex-rgb.go
  28. +3 −6 cmd/processor_html-decode.go
  29. +3 −6 cmd/processor_html-encode.go
  30. +3 −6 cmd/processor_json-escape.go
  31. +3 −6 cmd/processor_json-msgpack.go
  32. +3 −6 cmd/processor_json-unescape.go
  33. +3 −6 cmd/processor_json-yaml.go
  34. +3 −6 cmd/processor_json.go
  35. +3 −6 cmd/processor_kebab.go
  36. +3 −6 cmd/processor_lower.go
  37. +3 −6 cmd/processor_markdown-html.go
  38. +3 −6 cmd/processor_md5.go
  39. +4 −7 cmd/processor_morse-encode.go
  40. +3 −6 cmd/processor_msgpack-json.go
  41. +8 −11 cmd/{processor_rot13-encode.go → processor_pascal.go}
  42. +3 −6 cmd/processor_remove-newlines.go
  43. +3 −6 cmd/processor_remove-spaces.go
  44. +3 −6 cmd/processor_reverse-lines.go
  45. +3 −6 cmd/processor_reverse.go
  46. +53 −0 cmd/processor_rot13.go
  47. +4 −7 cmd/processor_sha1.go
  48. +7 −10 cmd/{processor_SHA224.go → processor_sha224.go}
  49. +4 −7 cmd/processor_sha256.go
  50. +7 −10 cmd/{processor_SHA384.go → processor_sha384.go}
  51. +4 −7 cmd/processor_sha512.go
  52. +3 −6 cmd/processor_shuffle-lines.go
  53. +3 −6 cmd/processor_slug.go
  54. +3 −6 cmd/processor_snake.go
  55. +3 −6 cmd/processor_sort-lines.go
  56. +3 −6 cmd/processor_title.go
  57. +3 −6 cmd/processor_unique-lines.go
  58. +3 −6 cmd/processor_upper.go
  59. +3 −6 cmd/processor_url-decode.go
  60. +3 −6 cmd/processor_url-encode.go
  61. +3 −6 cmd/processor_yaml-json.go
  62. +3 −6 cmd/processor_zeropad.go
  63. +28 −26 go.mod
  64. +59 −77 go.sum
  65. +20 −19 hugo/content/_index.md
  66. +9 −8 hugo/content/cli/sttr.md
  67. +7 −4 processors/ascii85.go
  68. +6 −6 processors/ascii85_test.go
  69. +7 −4 processors/base32.go
  70. +6 −6 processors/base32_test.go
  71. +8 −5 processors/base64.go
  72. +27 −17 processors/base64_test.go
  73. +8 −5 processors/base64url.go
  74. +27 −17 processors/base64url_test.go
  75. +34 −27 processors/crypto.go
  76. +31 −31 processors/crypto_test.go
  77. +3 −1 processors/emails.go
  78. +3 −3 processors/emails_test.go
  79. +10 −3 processors/hex.go
  80. +6 −6 processors/hex_test.go
  81. +7 −2 processors/html.go
  82. +6 −6 processors/html_test.go
  83. +4 −2 processors/ip.go
  84. +3 −3 processors/ip_test.go
  85. +22 −14 processors/json.go
  86. +25 −27 processors/json_test.go
  87. +15 −10 processors/lines.go
  88. +15 −15 processors/lines_test.go
  89. +4 −2 processors/markdown.go
  90. +3 −3 processors/markdown_test.go
  91. +8 −5 processors/morse.go
  92. +3 −3 processors/morse_test.go
  93. +8 −5 processors/processor.go
  94. +3 −3 processors/processor_test.go
  95. +3 −2 processors/rgb.go
  96. +3 −3 processors/rgb_test.go
  97. +0 −55 processors/rot.go
  98. +60 −0 processors/rot13.go
  99. +10 −10 processors/{rot_test.go → rot13_test.go}
  100. +5 −2 processors/spaces.go
  101. +6 −6 processors/spaces_test.go
  102. +133 −17 processors/strings.go
  103. +259 −38 processors/strings_test.go
  104. +50 −2 processors/url.go
  105. +85 −6 processors/url_test.go
  106. +18 −9 ui/ui.go
11 changes: 5 additions & 6 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -3,22 +3,21 @@ name: Go
on:
push:
branches:
- '*'
- "*"
pull_request:
branches:
- '*'
- "*"

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22

- name: Generate
run: go generate -v ./...
56 changes: 49 additions & 7 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -3,38 +3,80 @@ on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: write
packages: write
id-token: write
issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.1
with:
go-version: 1.19.x
go-version: stable
cache: true

- name: Set up Snapcraft
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: install chocolatey
- name: Install Chocolatey
run: |
mkdir -p /opt/chocolatey
wget -q -O - "https://github.com/chocolatey/choco/releases/download/1.3.0/chocolatey.v1.3.0.tar.gz " | tar -xz -C "/opt/chocolatey"
echo '#!/bin/bash' >> /usr/local/bin/choco
echo 'mono /opt/chocolatey/choco.exe $@' >> /usr/local/bin/choco
chmod +x /usr/local/bin/choco
- name: Install syft
uses: anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2

- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Install cosign
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0

- name: Login to ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Login to docker.io registry
uses: docker/login-action@v3
with:
username: abhimanyu003
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v6
with:
version: latest
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
AUR_KEY: ${{ secrets.AUR_SSH_KEY }}
GITHUB_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_LOGIN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
3 changes: 3 additions & 0 deletions .goreleaser.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM scratch
COPY sttr /usr/bin/sttr
ENTRYPOINT ["/usr/bin/sttr"]
182 changes: 158 additions & 24 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
project_name: 'sttr'

project_name: "sttr"
version: 2
# before are hooks that will be run before any builds are done, so good to put install scripts and stuff that your builds need here
before:
hooks:
# Remove unused packaged from the build process
- go mod tidy
- go generate


builds:
- main: ./main.go
binary: sttr
goos: [ 'linux', 'darwin', 'windows' ]
goarch: [ '386', 'amd64', 'arm64' ]
goos: ["linux", "darwin", "windows", "freebsd"]
goarch: ["386", "amd64", "arm64"]
flags:
- -trimpath
ldflags:
- -s -w -X "main.version={{.Version}}"
env:
@@ -22,12 +23,12 @@ universal_binaries:
- replace: true

changelog:
sort: 'asc'
sort: "asc"
filters:
exclude: [ '^docs:', 'demo', '^hugo:', 'Merge pull request', 'Merge branch' ]
exclude: ["^docs:", "demo", "^hugo:", "Merge pull request", "Merge branch"]

brews:
- tap:
- repository:
owner: abhimanyu003
name: homebrew-sttr
name: sttr
@@ -38,21 +39,21 @@ brews:
commit_author:
name: abhimanyu003
email: abhimanyusharma003@gmail.com
folder: Formula
directory: Formula
install: |-
bin.install "sttr"
test: |
system "#{bin}/sttr -v"
scoop:
bucket:
owner: abhimanyu003
name: scoop-bucket
token: "{{ .Env.GITHUB_TOKEN }}"
name: sttr
homepage: "https://github.com/abhimanyu003/sttr"
description: "sttr is command line software that allows you to quickly run various transformation operations on the string."
license: "MIT"
scoops:
- repository:
owner: abhimanyu003
name: scoop-bucket
token: "{{ .Env.GITHUB_TOKEN }}"
name: sttr
homepage: "https://github.com/abhimanyu003/sttr"
description: "sttr is command line software that allows you to quickly run various transformation operations on the string."
license: "MIT"

nfpms:
- builds:
@@ -65,6 +66,7 @@ nfpms:
formats:
- deb
- rpm
- archlinux
- termux.deb
bindir: /usr/bin

@@ -78,20 +80,19 @@ snapcrafts:
confinement: strict
license: MIT
base: core20

apps:
sttr:
plugs: [ "home", "network" ]
plugs: ["home", "network"]

aurs:
- name: sttr-bin
homepage: "https://github.com/abhimanyu003/sttr"
description: "sttr is command line software that allows you to quickly run various transformation operations on the string."
maintainers:
- 'Abhimanyu Sharma <abhimanyusharma003@gmail.com>'
- "Abhimanyu Sharma <abhimanyusharma003@gmail.com>"
license: "MIT"
private_key: '{{ .Env.AUR_KEY }}'
git_url: 'ssh://aur@aur.archlinux.org/sttr-bin.git'
private_key: "{{ .Env.AUR_KEY }}"
git_url: "ssh://aur@aur.archlinux.org/sttr-bin.git"
commit_author:
name: Abhimanyu Sharma
email: abhimanyusharma003@gmail.com
@@ -117,4 +118,137 @@ chocolateys:
release_notes: "https://github.com/abhimanyu003/sttr/releases/tag/v{{ .Version }}"
api_key: "{{ .Env.CHOCOLATEY_API_KEY }}"
source_repo: "https://push.chocolatey.org/"
skip_publish: true
skip_publish: true

sboms:
- artifacts: archive

dockers:
- skip_push: false
use: buildx
dockerfile: .goreleaser.Dockerfile
image_templates:
- ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-amd64
- docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-amd64
build_flag_templates:
- --platform=linux/amd64
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .Commit }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.description=a cross-platform, cli app to perform various operations on string
- --label=org.opencontainers.image.vendor=abhimanyu003
- --label=org.opencontainers.image.licenses=MIT
- --label=org.opencontainers.image.source=https://github.com/abhimanyu003/sttr
- --label=org.opencontainers.image.authors=Abhimanyu Sharma <abhimanyusharma003@gmail.com>

- skip_push: false
goarch: arm64
use: buildx
dockerfile: .goreleaser.Dockerfile
image_templates:
- ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-arm64
- docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-arm64
build_flag_templates:
- --platform=linux/arm64
- --label=org.opencontainers.image.version={{ .Version }}
- --label=org.opencontainers.image.revision={{ .Commit }}
- --label=org.opencontainers.image.title={{ .ProjectName }}
- --label=org.opencontainers.image.created={{ .Date }}
- --label=org.opencontainers.image.description=a cross-platform, cli app to perform various operations on string
- --label=org.opencontainers.image.vendor=abhimanyu003
- --label=org.opencontainers.image.licenses=MIT
- --label=org.opencontainers.image.source=https://github.com/abhimanyu003/sttr
- --label=org.opencontainers.image.authors=Abhimanyu Sharma <abhimanyusharma003@gmail.com>
docker_manifests:
- name_template: ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}
image_templates:
- ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-arm64
- name_template: ghcr.io/abhimanyu003/{{ .ProjectName }}:latest
image_templates:
- ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-amd64
- ghcr.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-arm64
- name_template: docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}
image_templates:
- docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-amd64
- docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-arm64
- name_template: docker.io/abhimanyu003/{{ .ProjectName }}:latest
image_templates:
- docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-amd64
- docker.io/abhimanyu003/{{ .ProjectName }}:{{ .Version }}-arm64

signs:
- cmd: cosign
signature: "${artifact}.sig"
certificate: "${artifact}.pem"
output: true
artifacts: checksum
args:
- sign-blob
- "--oidc-provider=github-actions"
- "--output-certificate=${certificate}"
- "--output-signature=${signature}"
- "${artifact}"
- --yes

docker_signs:
- cmd: cosign
artifacts: manifests
output: true
args:
- "sign"
- "--oidc-provider=github-actions"
- "${artifact}@${digest}"
- --yes

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

winget:
- name: sttr
publisher: abhimanyu003
publisher_url: https://github.com/abhimanyu003
short_description: cross-platform, cli app to perform various operations on string
license: MIT
commit_author:
name: Abhimanyu Sharma
email: abhimanyusharma003@gmail.com
homepage: https://github.com/abhimanyu003/sttr
license_url: https://github.com/abhimanyu003/sttr/blob/master/LICENSE
copyright: Copyright (c) 2021-{{ .Now.Format "2006" }} Abhimanyu Sharma
release_notes: "{{ .Changelog }}"
release_notes_url: https://github.com/abhimanyu003/sttr/releases/tag/{{ .Tag }}
tags:
- cli
- tui
- string
- transform
- devutil
- encoding
- productivity
author: Abhimanyu Sharma
publisher_support_url: https://github.com/abhimanyu003/sttr/issues
repository:
owner: abhimanyu003
name: winget-pkgs
branch: sttr-{{ .Version }}
token: "{{ .Env.GITHUB_TOKEN }}"
pull_request:
enabled: true
base:
owner: microsoft
name: winget-pkgs
branch: master
Loading