This repository was archived by the owner on Jun 23, 2026. It is now read-only.
Bump version to 1.6.1 #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Release | |
| on: | |
| push: | |
| branches: [dev, beta, main] | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| workflow_dispatch: | |
| inputs: | |
| prerelease: | |
| description: "Create as prerelease" | |
| required: false | |
| default: true | |
| type: boolean | |
| permissions: | |
| contents: write | |
| packages: write | |
| actions: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-pc-windows-msvc | |
| - name: Cache cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| encryptx-backend/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build Windows binary | |
| run: | | |
| cd encryptx-backend | |
| cargo build --release --target x86_64-pc-windows-msvc | |
| - name: Get version from package.json | |
| id: get_version | |
| run: | | |
| $VERSION = (Get-Content package.json | ConvertFrom-Json).version | |
| echo "version=$VERSION" >> $env:GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Create Windows package | |
| run: | | |
| mkdir encryptx-windows | |
| copy encryptx-backend\target\x86_64-pc-windows-msvc\release\encryptx-backend.exe encryptx-windows\encryptx.exe | |
| copy README.md encryptx-windows\ | |
| copy LICENSE encryptx-windows\ | |
| echo "EncryptX CLI v${{ steps.get_version.outputs.version }}" > encryptx-windows\VERSION.txt | |
| echo "Build: ${{ github.sha }}" >> encryptx-windows\VERSION.txt | |
| echo "Date: ${{ github.event.head_commit.timestamp }}" >> encryptx-windows\VERSION.txt | |
| - name: Create MSI installer | |
| run: | | |
| choco install wixtoolset -y --force | |
| $wxsContent = @' | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> | |
| <Product Id="*" Name="EncryptX CLI" Language="1033" Version="${{ steps.get_version.outputs.version }}" Manufacturer="AmitxD" UpgradeCode="{12345678-1234-1234-1234-123456789012}"> | |
| <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Platform="x64" /> | |
| <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> | |
| <MediaTemplate EmbedCab="yes" /> | |
| <Feature Id="ProductFeature" Title="EncryptX CLI" Level="1"> | |
| <ComponentGroupRef Id="ProductComponents" /> | |
| </Feature> | |
| <SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLFOLDER]" After="CostFinalize" /> | |
| </Product> | |
| <Fragment> | |
| <Directory Id="TARGETDIR" Name="SourceDir"> | |
| <Directory Id="ProgramFiles64Folder"> | |
| <Directory Id="INSTALLFOLDER" Name="EncryptX" /> | |
| </Directory> | |
| </Directory> | |
| </Fragment> | |
| <Fragment> | |
| <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | |
| <Component Id="MainExecutable" Guid="{12345678-1234-1234-1234-123456789014}" Win64="yes"> | |
| <File Id="EncryptXExe" Source="encryptx-windows\encryptx.exe" KeyPath="yes" /> | |
| <Environment Id="PATH" Name="PATH" Value="[INSTALLFOLDER]" Permanent="no" Part="last" Action="set" System="yes" /> | |
| </Component> | |
| <Component Id="Documentation" Guid="{12345678-1234-1234-1234-123456789015}" Win64="yes"> | |
| <File Id="ReadmeFile" Source="encryptx-windows\README.md" /> | |
| <File Id="LicenseFile" Source="encryptx-windows\LICENSE" /> | |
| <File Id="VersionFile" Source="encryptx-windows\VERSION.txt" /> | |
| </Component> | |
| </ComponentGroup> | |
| </Fragment> | |
| </Wix> | |
| '@ | |
| $wxsContent | Out-File -FilePath "encryptx.wxs" -Encoding UTF8 | |
| $wixPath = Get-ChildItem "C:\Program Files (x86)" -Directory -Name "WiX Toolset*" | Sort-Object -Descending | Select-Object -First 1 | |
| $candlePath = "C:\Program Files (x86)\$wixPath\bin\candle.exe" | |
| $lightPath = "C:\Program Files (x86)\$wixPath\bin\light.exe" | |
| & $candlePath encryptx.wxs | |
| & $lightPath -ext WixUIExtension encryptx.wixobj -o encryptx-windows\encryptx-installer.msi | |
| - name: Upload Windows artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: encryptx-windows | |
| path: encryptx-windows/ | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-gnu | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y pkg-config libssl-dev | |
| - name: Cache cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| encryptx-backend/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build Linux binary | |
| run: | | |
| cd encryptx-backend | |
| cargo build --release --target x86_64-unknown-linux-gnu | |
| - name: Get version from package.json | |
| id: get_version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Create Linux package | |
| run: | | |
| mkdir encryptx-linux | |
| cp encryptx-backend/target/x86_64-unknown-linux-gnu/release/encryptx-backend encryptx-linux/encryptx | |
| cp README.md encryptx-linux/ | |
| cp LICENSE encryptx-linux/ | |
| echo "EncryptX CLI v${{ steps.get_version.outputs.version }}" > encryptx-linux/VERSION.txt | |
| echo "Build: ${{ github.sha }}" >> encryptx-linux/VERSION.txt | |
| echo "Date: ${{ github.event.head_commit.timestamp }}" >> encryptx-linux/VERSION.txt | |
| cat > encryptx-linux/install.sh << 'EOF' | |
| #!/bin/bash | |
| set -e | |
| if [[ $EUID -eq 0 ]]; then | |
| INSTALL_DIR="/usr/local/bin" | |
| else | |
| INSTALL_DIR="$HOME/.local/bin" | |
| mkdir -p "$INSTALL_DIR" | |
| fi | |
| cp encryptx "$INSTALL_DIR/" | |
| chmod +x "$INSTALL_DIR/encryptx" | |
| echo "EncryptX CLI installed to $INSTALL_DIR/encryptx" | |
| if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then | |
| echo "Add to PATH: export PATH=\"$INSTALL_DIR:\$PATH\"" | |
| fi | |
| EOF | |
| chmod +x encryptx-linux/install.sh | |
| tar -czf encryptx-linux-x64.tar.gz -C encryptx-linux . | |
| - name: Upload Linux artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: encryptx-linux | |
| path: | | |
| encryptx-linux-x64.tar.gz | |
| encryptx-linux/ | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin | |
| - name: Cache cargo dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| encryptx-backend/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build macOS binary | |
| run: | | |
| cd encryptx-backend | |
| cargo build --release --target aarch64-apple-darwin | |
| - name: Get version from package.json | |
| id: get_version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Create macOS package | |
| run: | | |
| mkdir encryptx-macos | |
| cp encryptx-backend/target/aarch64-apple-darwin/release/encryptx-backend encryptx-macos/encryptx | |
| cp README.md encryptx-macos/ | |
| cp LICENSE encryptx-macos/ | |
| echo "EncryptX CLI v${{ steps.get_version.outputs.version }}" > encryptx-macos/VERSION.txt | |
| echo "Build: ${{ github.sha }}" >> encryptx-macos/VERSION.txt | |
| echo "Date: ${{ github.event.head_commit.timestamp }}" >> encryptx-macos/VERSION.txt | |
| cat > encryptx-macos/install.sh << 'EOF' | |
| #!/bin/bash | |
| set -e | |
| if [[ $EUID -eq 0 ]]; then | |
| INSTALL_DIR="/usr/local/bin" | |
| else | |
| INSTALL_DIR="$HOME/.local/bin" | |
| mkdir -p "$INSTALL_DIR" | |
| fi | |
| cp encryptx "$INSTALL_DIR/" | |
| chmod +x "$INSTALL_DIR/encryptx" | |
| xattr -d com.apple.quarantine "$INSTALL_DIR/encryptx" 2>/dev/null || true | |
| echo "EncryptX CLI installed to $INSTALL_DIR/encryptx" | |
| if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then | |
| echo "Add to PATH: export PATH=\"$INSTALL_DIR:\$PATH\"" | |
| fi | |
| EOF | |
| chmod +x encryptx-macos/install.sh | |
| tar -czf encryptx-macos-arm64.tar.gz -C encryptx-macos . | |
| - name: Upload macOS artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: encryptx-macos | |
| path: | | |
| encryptx-macos-arm64.tar.gz | |
| encryptx-macos/ | |
| create-release: | |
| needs: [build-windows, build-linux, build-macos] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get version from package.json | |
| id: get_version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Prepare release assets | |
| run: | | |
| mkdir release-assets | |
| cp encryptx-windows/encryptx-installer.msi release-assets/encryptx-windows-x64-installer.msi | |
| cp encryptx-linux/encryptx-linux-x64.tar.gz release-assets/ | |
| cp encryptx-macos/encryptx-macos-arm64.tar.gz release-assets/ | |
| cd release-assets | |
| sha256sum * > checksums.txt | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1.14.0 | |
| with: | |
| artifacts: "release-assets/*" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| name: "EncryptX v${{ steps.get_version.outputs.version }}" | |
| tag: "v${{ steps.get_version.outputs.version }}" | |
| prerelease: true | |
| makeLatest: false | |
| body: | | |
| ## EncryptX v${{ steps.get_version.outputs.version }} | |
| **Branch:** `${{ github.ref_name }}` | |
| **Commit:** `${{ github.sha }}` | |
| **Date:** ${{ github.event.head_commit.timestamp }} | |
| ### Downloads | |
| | Platform | Architecture | File | | |
| |----------|-------------|------| | |
| | Windows | x64 | [MSI Installer](./encryptx-windows-x64-installer.msi) | | |
| | Linux | x64 | [Tarball](./encryptx-linux-x64.tar.gz) | | |
| | macOS | ARM64 | [Tarball](./encryptx-macos-arm64.tar.gz) | | |
| ### Installation | |
| **Windows:** Run the MSI installer | |
| **Linux/macOS:** Extract tarball and run `./install.sh` | |
| ### Usage | |
| ```bash | |
| # Encrypt file | |
| encryptx encrypt --file document.pdf --password secret | |
| # Decrypt file | |
| encryptx decrypt --file document.xd --password secret | |
| # Generate key | |
| encryptx generate-key | |
| ``` | |
| ### Verification | |
| ```bash | |
| sha256sum -c checksums.txt | |
| ``` | |
| cleanup: | |
| needs: create-release | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Delete artifacts | |
| uses: geekyeggo/delete-artifact@v5 | |
| with: | |
| name: | | |
| encryptx-windows | |
| encryptx-linux | |
| encryptx-macos |