Skip to content

Commit

Permalink
Add WAPM.io publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
luksamuk committed Oct 25, 2022
1 parent f99a621 commit 93cc4aa
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 19 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,25 @@ jobs:
artifacts: "builds/majestic-lisp-x86_64.tar.gz,builds/majestic-lisp-win64.zip,builds/majestic-lisp-wasm32-wasi.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}

wapm-release:
# Run only for tags
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
needs: [deploy-wasi]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Recover artifacts
uses: actions/download-artifact@v2
- name: Reposition generated WASM file
run: |
mkdir -p target/wasm32-wasi/release/
tar zxvf builds/majestic-lisp-wasm32-wasi.tar.gz
mv majestic-lisp.wasm target/wasm32-wasi/release/
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v1
- name: Publish to WAPM
uses: wasmerio/wapm-publish@v1
with:
username: ${{ secrets.WAPM_USERNAME }}
password: ${{ secrets.WAPM_PASSWORD }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ target/
.majestic_history
test-streams-in.txt
test-streams-out.txt

wapm_packages
34 changes: 32 additions & 2 deletions 03-configuracao.org
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ ferramenta ~cargo~.
#+begin_src toml :tangle Cargo.toml
[package]
name = "majestic-lisp"
version = "0.4.0"
authors = ["Lucas Vieira <[email protected]>"]
version = "0.4.2"
authors = ["Lucas S. Vieira <[email protected]>"]
description = "Lisp dialect built with Rust as a literate program"
license = "MIT"
keywords = ["lisp", "language", "dialect", "interpreter"]
Expand Down Expand Up @@ -114,6 +114,36 @@ arquivo ~rust-toolchain~:
nightly
#+end_src

* Configuração para exportação de WebAssembly

A configuração a seguir (arquivo ~wapm.toml~) determina a configuração
necessária para a publicação do pacote do Majestic Lisp no [[https://wapm.io/][WAPM.io]]. Dessa forma,
o projeto poderá também ser utilizado no [[https://webassembly.sh/][WebAssembly.sh]].

#+begin_src toml :tangle wapm.toml
[package]
name = "luksamuk/majestic-lisp"
version = "0.4.2"
description = "Lisp dialect built with Rust as a literate program"
license = "MIT"
license-file = "LICENSE"
repository = "https://github.com/luksamuk/majestic-lisp"
wasmer-extra-flags = "--enable-bulk-memory"

[[module]]
name = "majestic"
source = "./target/wasm32-wasi/release/majestic-lisp.wasm"
abi = "wasi"

[module.interfaces]
wasi = "0.1.0-unstable"

[[command]]
name = "majestic"
module = "majestic"
package = "luksamuk/majestic-lisp"
#+end_src

* Compilação

Para compilarmos o projeto, podemos criar um arquivo ~Makefile~ que
Expand Down
2 changes: 1 addition & 1 deletion C-manpage.org
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Manual do ~troff~[fn:1].
#+begin_src nroff
.\" Majestic Lisp manpage
.\" Copyright (c) 2020-2021 Lucas S. Vieira
.TH majestic 1 "Updated 2022-10-24" "majestic-0.4.0" "MAJESTIC"
.TH majestic 1 "Updated 2022-10-25" "majestic-0.4.2" "MAJESTIC"
#+end_src

** Nome
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "majestic-lisp"
version = "0.4.0"
authors = ["Lucas Vieira <[email protected]>"]
version = "0.4.2"
authors = ["Lucas S. Vieira <[email protected]>"]
description = "Lisp dialect built with Rust as a literate program"
license = "MIT"
keywords = ["lisp", "language", "dialect", "interpreter"]
Expand Down
48 changes: 42 additions & 6 deletions doc/html/03-configuracao.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions doc/html/09-ponto-de-entrada.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions doc/html/C-manpage.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions doc/html/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions index.org
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ Você poderá encontrar o código separado [[https://github.com/luksamuk/majest
certifique-se de que *editar apenas os arquivos .org*; nenhum arquivo de código
deverá ser editado diretamente.

* Execução do projeto no browser
:PROPERTIES:
:UNNUMBERED: t
:END:

*NOVO!* Você poderá agora executar o projeto em sua versão mais estável através
do [[https://webassembly.sh][WebAssembly.sh]]. Para tanto, acesse o site e, no console que abre, digite:

#+begin_src bash :tangle no :eval no
wapm install luksamuk/majestic-lisp
majestic
#+end_src

O projeto ainda é um pouco delicado, e por enquanto pede input através de uma
janela no console, mas você poderá utilizá-lo como teste.

* Licenciamento
:PROPERTIES:
:UNNUMBERED: t
Expand Down
2 changes: 1 addition & 1 deletion man/man1/majestic.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" Majestic Lisp manpage
.\" Copyright (c) 2020-2021 Lucas S. Vieira
.TH majestic 1 "Updated 2022-10-24" "majestic-0.4.0" "MAJESTIC"
.TH majestic 1 "Updated 2022-10-25" "majestic-0.4.2" "MAJESTIC"
.SH "NAME"
.P
majestic \- \fIMajestic Lisp Interpreter\fP
Expand Down
18 changes: 18 additions & 0 deletions wapm.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Lockfile v4
# This file is automatically generated by Wapm.
# It is not intended for manual editing. The schema of this file may change.
[modules."luksamuk/majestic-lisp"."0.4.2".majestic]
name = "majestic"
package_version = "0.4.2"
package_name = "luksamuk/majestic-lisp"
package_path = "luksamuk/[email protected]"
resolved = "local"
resolved_source = "local"
abi = "wasi"
source = "./target/wasm32-wasi/release/majestic-lisp.wasm"
[commands.majestic]
name = "majestic"
package_name = "luksamuk/majestic-lisp"
package_version = "0.4.2"
module = "majestic"
is_top_level_dependency = true
21 changes: 21 additions & 0 deletions wapm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "luksamuk/majestic-lisp"
version = "0.4.2"
description = "Lisp dialect built with Rust as a literate program"
license = "MIT"
license-file = "LICENSE"
repository = "https://github.com/luksamuk/majestic-lisp"
wasmer-extra-flags = "--enable-bulk-memory"

[[module]]
name = "majestic"
source = "./target/wasm32-wasi/release/majestic-lisp.wasm"
abi = "wasi"

[module.interfaces]
wasi = "0.1.0-unstable"

[[command]]
name = "majestic"
module = "majestic"
package = "luksamuk/majestic-lisp"

0 comments on commit 93cc4aa

Please sign in to comment.