Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial crate #1

Merged
merged 21 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish (NPM)

on:
release:
types: [published]

jobs:

publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
always-auth: true
- uses: stellar/binaries@v23
with:
name: wasm-pack
version: 0.12.1
- uses: stellar/binaries@v23
with:
name: wasm-bindgen-cli
version: 0.2.92
- run: make build
- run: wasm-pack publish --target web
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
81 changes: 81 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Rust

on:
push:
branches: [main, release/**]
pull_request:
merge_group:

defaults:
run:
shell: bash

env:
RUSTFLAGS: -Dwarnings

jobs:

complete:
if: always()
needs: [fmt, check-git-rev-deps, build-and-test]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update
- run: cargo fmt --all --check

cargo-deny:
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@b01e7a8cfb1f496c52d77361e84c1840d8246393
with:
command: check ${{ matrix.checks }}

check-git-rev-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-check-git-rev-deps@main

build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: stellar/actions/rust-cache@main
- uses: stellar/binaries@v23
with:
name: wasm-pack
version: 0.12.1
- uses: stellar/binaries@v23
with:
name: wasm-bindgen-cli
version: 0.2.92
- run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
- run: rustup update
- run: cargo version
- run: rustup target add wasm32-unknown-unknown
- run: make build
- uses: actions/upload-artifact@v4
with:
name: web
path: pkg/web
- uses: actions/upload-artifact@v4
with:
name: deno
path: pkg/deno
- run: make test
- run: git add -N . && git diff HEAD --exit-code
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
/pkg/
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing

## Development

### Build

```
make build
```

### Test

```
make test
```
Loading
Loading