Skip to content

Commit

Permalink
updating workflows to include wasm as a part of release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
shibme committed May 17, 2024
1 parent 5f43d42 commit 996dd51
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 14 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Deploy static content to GitHub Pages

on:
push:
tags:
- 'v*'
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
Expand All @@ -26,15 +26,29 @@ jobs:
- name: Prepare pages directory
run: |
cp scripts/install/* pages/
- name: Set up Go
uses: actions/setup-go@v5
- uses: robinraju/[email protected]
with:
go-version: 'stable'
- name: Build WASM to pages directory
latest: true
fileName: '*wasm*'
- name: Add WASM files to pages directory
run: |
unzip xipher_js_wasm.zip
mkdir -p pages/wasm
GOOS=js GOARCH=wasm go build -o pages/wasm/xipher.wasm ./app/wasm
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" pages/wasm/
mv wasm_exec.js pages/wasm/
mv xipher.wasm pages/wasm/
- name: Checkout xenigma
uses: actions/checkout@v4
with:
repository: shibina3/xenigma
path: xenigma
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Install node dependencies
run: npm -C xenigma ci
- name: Build Xenigma
run: npm -C xenigma run build
- name: Add pages from Xenigma
run: mv xenigma/build pages/web
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_SSH_KEY: ${{ secrets.HOMEBREW_SSH_KEY }}
- name: Prepare wasm_exec.js
run: cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./
- name: Upload wasm_exec.js to the current release
uses: softprops/action-gh-release@v2
with:
files: wasm_exec.js
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
Expand Down
10 changes: 9 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
project_name: xipher
builds:
- main: ./app/cmd
- id: xipher
main: ./app/cmd
env:
- CGO_ENABLED=0
ldflags: "-X dev.shib.me/xipher.version={{.Version}} -X dev.shib.me/xipher.commitDate={{.CommitDate}} -X dev.shib.me/xipher.fullCommit={{.FullCommit}} -X dev.shib.me/xipher.releaseURL={{.ReleaseURL}}"
Expand All @@ -11,6 +12,13 @@ builds:
- linux_arm64
- linux_arm
- windows_amd64
- id: xipher-wasm
main: ./app/wasm
env:
- CGO_ENABLED=0
ldflags: "-X dev.shib.me/xipher.version={{.Version}} -X dev.shib.me/xipher.commitDate={{.CommitDate}} -X dev.shib.me/xipher.fullCommit={{.FullCommit}} -X dev.shib.me/xipher.releaseURL={{.ReleaseURL}}"
targets:
- js_wasm
archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@

Xipher is a curated collection of cryptographic primitives put together to perform key/password based asymmetric encryption.

### What does it do?
## What does it do?

- Allows sharing of data securely between two parties over an insecure channel using asymmetric encryption.
- The sender encrypts the data using a public key (received from a receiver) derived from a password and shares the encrypted data with the receiver.
- The receiver decrypts the data using the same password.

## Key Aspects
- Encrypts data with the public key generated based on a password.
- Supports stream cipher along with stream compression, resulting in lower memory footprint.
- Supports post-quantum cryptography using the Kyber algorithm.

## Demo
## CLI
Download the latest binary from the [releases](https://github.com/shibme/xipher/releases/latest) page and add it to your path.

![Demo](https://dev.shib.me/xipher/demo/xipher_text.gif)
### Demo

## CLI Installation
Download the latest binary from the [releases](https://github.com/shibme/xipher/releases/latest) page and add it to your path.
![Demo](https://dev.shib.me/xipher/demo/xipher_text.gif)

### Homebrew
Xipher can be installed with brew using the following command on macOS
Expand Down Expand Up @@ -53,6 +59,11 @@ You can also run Xipher without installing using Docker:
docker run --rm -v $PWD:/data -it shibme/xipher help
```

## Web Interface

- An interoperable web interface implemented using [web assembly](#web-assembly) is available at [https://dev.shib.me/xipher/web](https://dev.shib.me/xipher/web).
- The source code for the web implementation is available at [shibina3/xenigma](https://github.com/shibina3/xenigma).

## Using as a Go package
Install the package
```sh
Expand Down

0 comments on commit 996dd51

Please sign in to comment.