diff --git a/.github/workflows/binaries.yaml b/.github/workflows/binaries.yaml new file mode 100644 index 0000000..4a330b1 --- /dev/null +++ b/.github/workflows/binaries.yaml @@ -0,0 +1,68 @@ +name: Build binaries and Release + +on: + push: + branches: + - main + tags: + - "v*" + +jobs: + build-and-release: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Cache Python Dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.13' + + - name: Install Dependencies and Tools + run: | + pip install --upgrade pip + pip install pyinstaller + pip install -r <(python -c ' + import toml + with open("pyproject.toml", "r") as f: + project = toml.load(f)["project"] + dependencies = project.get("dependencies", []) + print("\\n".join(dependencies)) + ') + + - name: Build binary + run: pyinstaller --onefile --name envcloak --distpath binaries envcloak/cli.py + + - name: Rename Binaries + run: | + if [[ "$RUNNER_OS" == "Linux" ]]; then + mv binaries/envcloak binaries/envcloak-linux + elif [[ "$RUNNER_OS" == "macOS" ]]; then + mv binaries/envcloak binaries/envcloak-macos + elif [[ "$RUNNER_OS" == "Windows" ]]; then + mv binaries/envcloak binaries/envcloak-windows.exe + fi + + - name: Upload binaries to release + uses: softprops/action-gh-release@v1 + with: + files: | + binaries/envcloak-linux + binaries/envcloak-macos + binaries/envcloak-windows.exe + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 9c636af..1571680 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ or if you want `dev` tools too 😎: pip install envcloak[dev] ``` +> 👋 There are also [self-contained binaries](examples/cli/README.MD#get-yourself-a-envcloak-without-requirement-to-use-python-) for `Windows`, `Linux` and `MacOS`, don't have to use python at all! đŸĨŗ + ## 🚀 Example Workflow > ℹī¸ More examples are present in [examples](./examples) section. diff --git a/examples/cli/README.md b/examples/cli/README.md index 1f1a3cf..cb6e3c7 100644 --- a/examples/cli/README.md +++ b/examples/cli/README.md @@ -185,3 +185,18 @@ Distribute the `.env.enc` file and keep the `myproject.key` secure. * Never commit keys: Always use `.gitignore` to exclude `key` files. * Secure `password`s and `salt`s: Treat them as sensitive as the `key`s themselves. * Automate `encryption`/`decryption`: Include EnvCloak commands in CI/CD pipelines or scripts for consistency. + + + +## Get yourself a EnvCloak without requirement to use Python! đŸĨŗ +Download self-contained binary: +```bash +# For Linux +wget -O envcloak https://github.com/Veinar/envcloak/releases/latest/download/envcloak-linux + +# For macOS +wget -O envcloak https://github.com/Veinar/envcloak/releases/latest/download/envcloak-macos + +# For Windows +wget -O envcloak.exe https://github.com/Veinar/envcloak/releases/latest/download/envcloak-windows.exe +``` \ No newline at end of file