-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit cb6cb92
Showing
37 changed files
with
1,985 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* linguist-vendored=true | ||
*.ts linguist-vendored=false | ||
*.rs linguist-vendored=false | ||
dist/* linguist-vendored=true | ||
pkg/* linguist-vendored=true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
on: [push] | ||
|
||
name: commit | ||
|
||
jobs: | ||
check: | ||
name: check | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: 'docker compose up --build' | ||
- run: 'git status --porcelain' | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: pkg | ||
path: ./wasm/pkg/ | ||
- run: '[[ -z $(git status --porcelain) ]]' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules | ||
/dist | ||
.DS_Store |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.unstable": true, | ||
"deno.enablePaths": [ | ||
"./src/deno", | ||
"./example/deno" | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM rust:1.71.0 | ||
|
||
WORKDIR /app | ||
|
||
RUN cargo install wasm-pack | ||
|
||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash | ||
RUN apt-get install -y nodejs | ||
RUN npm config set cache /tmp --global | ||
|
||
RUN chmod -R 777 /usr/local/cargo | ||
RUN chmod -R 777 /root | ||
|
||
CMD npm ci && npm run build |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Haz Æ 41 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Example Rust Snap | ||
|
||
An example Snap written in Rust | ||
|
||
## Building | ||
|
||
### Unreproducible building | ||
|
||
You need to install [Rust](https://www.rust-lang.org/tools/install) | ||
|
||
Then, install [wasm-pack](https://github.com/rustwasm/wasm-pack) | ||
|
||
```bash | ||
cargo install wasm-pack | ||
``` | ||
|
||
Finally, do a clean install and build | ||
|
||
```bash | ||
npm ci && npm run build | ||
``` | ||
|
||
### Reproducible building | ||
|
||
You can build the exact same bytecode using Docker, just be sure you're on a `linux/amd64` host | ||
|
||
```bash | ||
docker compose up --build | ||
``` | ||
|
||
Then check that all the files are the same using `git status` | ||
|
||
```bash | ||
git status --porcelain | ||
``` | ||
|
||
If the output is empty then the bytecode is the same as the one I commited | ||
|
||
### Automated checks | ||
|
||
Each time I commit to the repository, the GitHub's CI does the following: | ||
- Clone the repository | ||
- Reproduce the build using `docker compose up --build` | ||
- Throw an error if the `git status --porcelain` output is not empty |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 1.x | :white_check_mark: | | ||
|
||
## Reporting a Vulnerability | ||
|
||
Contact me at [email protected] or [email protected] or on Twitter @hazae41 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: "3.8" | ||
|
||
services: | ||
app: | ||
build: . | ||
volumes: | ||
- ".:/app" |
Oops, something went wrong.