File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ name: Build and Release Artifacts
22
33permissions :
44 contents : write
5+ packages : write
56
67on :
78 push :
@@ -28,11 +29,19 @@ jobs:
2829
2930 - name : Build wasm
3031 run : nix build ".#wasm"
31-
32- - name : Copy wasm Result
32+
33+ - name : Publish built wasm package
3334 run : |
34- cp -r ./result/main.wasm ${{ github.workspace }}/artifacts/mms.wasm
35- cp -r ./result/wasm_exec.js ${{ github.workspace }}/artifacts/go_wasm_loader.js
35+ cd ./result/js
36+ echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > .npmrc
37+ echo "@minecraftmetascript:registry=https://npm.pkg.github.com" >> .npmrc
38+ npm publish --access public
39+
40+
41+ # - name: Copy wasm Result
42+ # run: |
43+ # cp -r ./result/main.wasm ${{ github.workspace }}/artifacts/mms.wasm
44+ # cp -r ./result/wasm_exec.js ${{ github.workspace }}/artifacts/go_wasm_loader.js
3645
3746 - name : Get tag name
3847 id : get_tag
Original file line number Diff line number Diff line change 1414 let
1515 pkgs = import nixpkgs { inherit system ; } ;
1616 antlrBuild = pkgs . writeShellApplication {
17- name = "antlr-build" ;
18- runtimeInputs = [
19- pkgs . antlr4
20- pkgs . go
21- ] ;
22- text = ''
23- set -e
24- src="./grammar"
25- dst="./lang"
26- ${ pkgs . antlr4 } /bin/antlr4 -Dlanguage=Go $src/Main_Lexer.g4 -o $dst -package grammar;
27- ${ pkgs . antlr4 } /bin/antlr4 -Dlanguage=Go $src/Main_Parser.g4 -lib $dst/grammar -o $dst -package grammar;
28- '' ;
29- } ;
17+ name = "antlr-build" ;
18+ runtimeInputs = [
19+ pkgs . antlr4
20+ pkgs . go
21+ ] ;
22+ text = ''
23+ set -e
24+ src="./grammar"
25+ dst="./lang"
26+ ${ pkgs . antlr4 } /bin/antlr4 -Dlanguage=Go $src/Main_Lexer.g4 -o $dst -package grammar;
27+ ${ pkgs . antlr4 } /bin/antlr4 -Dlanguage=Go $src/Main_Parser.g4 -lib $dst/grammar -o $dst -package grammar;
28+ '' ;
29+ } ;
3030 in
3131 {
3232 devShells . default = pkgs . mkShell {
33- env = {
34- GOROOT = "${ pkgs . go } /share/go" ;
35- } ;
36-
33+ env = {
34+ GOROOT = "${ pkgs . go } /share/go" ;
35+ } ;
36+
3737 buildInputs = [
3838 pkgs . antlr4
3939 pkgs . go
7474 subPackages = [ "." ] ;
7575
7676 preBuild = ''
77- ${ antlrBuild } /bin/antlr-build
77+ ${ antlrBuild } /bin/antlr-build
7878 '' ;
7979 } ;
8080
Original file line number Diff line number Diff line change 11{
22 "name" : " @mms/wasm" ,
3- "version" : " 0.1 .0" ,
3+ "version" : " 0.2 .0" ,
44 "keywords" : [],
55 "author" : " " ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments