From ca6c151f36b61da7e081591dc42d4b92145b3e47 Mon Sep 17 00:00:00 2001 From: nomionz Date: Wed, 31 Jan 2024 11:39:35 +0100 Subject: [PATCH] add ci and update readme --- .github/workflows/build_push.yaml | 77 +++++++++++++++++++++++++++++++ README.md | 22 +++++---- go.mod | 2 +- 3 files changed, 91 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/build_push.yaml diff --git a/.github/workflows/build_push.yaml b/.github/workflows/build_push.yaml new file mode 100644 index 0000000..479cb63 --- /dev/null +++ b/.github/workflows/build_push.yaml @@ -0,0 +1,77 @@ +name: Build and Publish Release + +on: + push: + tags: + - '*' + +env: + ARTIFACT_NAME: "fsenc" + +jobs: + build: + name: Build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 'stable' + + - name: Build project + shell: bash + run: | + if [ "${{ matrix.os }}" = "windows-latest" ]; then + go build -o ${{ env.ARTIFACT_NAME }}.exe + else + go build -o ${{ env.ARTIFACT_NAME }} + fi + + - name: Install 7zip (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install 7zip + + - name: Archive production artifacts + shell: bash + run: | + if [ "${{ matrix.os }}" = "windows-latest" ]; then + 7z a ${{ env.ARTIFACT_NAME }}.zip ./${{ env.ARTIFACT_NAME }}.exe + else + tar -czvf ${{ env.ARTIFACT_NAME }}.tar.gz ./${{ env.ARTIFACT_NAME }} + fi + + - name: Upload production artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ runner.os }}-artifact + retention-days: 1 + path: | + ${{ env.ARTIFACT_NAME }}${{ matrix.os == 'windows-latest' && '.zip' || '.tar.gz' }} + + - run: ls -R + + release: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - run: ls -R + + - name: Upload Artifacts to Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: './*-artifact/*' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 3cddea9..a567168 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,24 @@ -# fs-enc -CLI tool to encrypt and decrypt files with passphrase +# FSENC +FSENC is a lightweight, command-line interface tool designed for encrypting and decrypting files using a passphrase. It's an ideal solution for those who need to secure individual files containing sensitive information without the overhead of encrypting their entire filesystem. -## Why? +### Download from [Releases](https://github.com/nomionz/test/releases/) -One of my use cases is to encrypt files stored in the **home** directory that may contain sensitive information. +## Why FSENC? -I don't need to encrypt the whole file system, just a couple of files. +- Selective Encryption: Perfect for encrypting specific files in your home directory or any other location, ensuring sensitive information is kept private. +- Ease of Use: A straightforward CLI tool, making file encryption and decryption as simple as a single command. +- Security: Uses robust encryption algorithms to secure your files, safeguarding them against unauthorized access. ## Usage -## Encrypt +## Encrypting a File +To encrypt a file, use the enc command followed by the file path and a passphrase of your choice: ```bash -fs-enc enc +fsenc enc ``` -## Decrypt +## Decrypting a File +To decrypt an encrypted file, use the dec command followed by the file path and the correct passphrase: ```bash -fs-enc dec +fsenc dec ``` diff --git a/go.mod b/go.mod index 48af69d..0d3f431 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nomionz/fs-enc -go 1.21.2 +go 1.21 require golang.org/x/crypto v0.18.0