Skip to content

Commit

Permalink
bin-pack
Browse files Browse the repository at this point in the history
  • Loading branch information
warycat committed Jan 24, 2022
1 parent 4e5ce54 commit 4bdec0d
Show file tree
Hide file tree
Showing 8 changed files with 4,356 additions and 2,905 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,10 @@ jobs:

- name: Install diesel_cli
run: cargo install diesel_cli --no-default-features --features sqlite
- name: Run migration
run: cargo make migration
- name: Make readme
run: cargo make readme
- name: Build release
run: cargo build --verbose --release
- name: Copy server
run: cargo make copy-server
- name: Copy ingest
run: cargo make copy-ingest
- name: Archive bin
run: cargo make bin-pack
- name: Build wasm
run: cargo make wasm-pack
- name: Archive wasm
Expand All @@ -67,35 +61,15 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload sqlite
id: upload-sqlite
- name: Upload bin
id: upload-bin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rustgym.sqlite
asset_name: rustgym.sqlite
asset_content_type: application/vnd.sqlite3
- name: Upload server
id: upload-server
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rustgym-server
asset_name: rustgym-server
asset_content_type: application/octet-stream
- name: Upload ingest
id: upload-ingest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rustgym-ingest
asset_name: rustgym-ingest
asset_path: ./bin.tar.gz
asset_name: bin.tar.gz
asset_content_type: application/octet-stream
- name: Upload pkg
id: upload-pkg
Expand Down
37 changes: 17 additions & 20 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,32 @@ default_to_workspace = false
script = "git submodule update --init"

[tasks.rm_sqlite]
script = ["rm rustgym.sqlite"]
script = "rm ${RUSTGYM_SQLITE}"

[tasks.print-schema]
script = [
"diesel print-schema run --database-url rustgym.sqlite >> schema/schema.rs"
]
script = "diesel print-schema run --database-url ${RUSTGYM_SQLITE} > schema/src/schema.rs"

[tasks.migration]
script = ["diesel migration run --database-url rustgym.sqlite"]
script = "diesel migration run --database-url ${RUSTGYM_SQLITE}"

[tasks.readme]
script = ["cargo run --bin rustgym-readme"]
script = "cargo run --bin rustgym-readme"
dependencies = ["rm_sqlite", "migration"]

[tasks.copy-server]
script = 'cp target/release/rustgym-server rustgym-server'

[tasks.copy-ingest]
script = 'cp target/release/rustgym-ingest rustgym-ingest'
[tasks.openvgdb]
script = [
"curl -LJO ${OPENVGDB_DOWNLOAD_ZIP}",
"unzip openvgdb.zip",
"mv openvgdb.sqlite ${OPENVGDB_SQLITE}",
"rm openvgdb.zip",
"cargo run --bin openvgdb"
]

[tasks.wasm-pack]
script = 'wasm-pack build wasm --target no-modules --out-dir ../pkg'
script = "wasm-pack build wasm --target no-modules --out-dir ../pkg"

[tasks.bin-pack]
script = ["cargo build --release", "tar -czvf bin.tar.gz -T infra/bin.txt"]

[tasks.archive-wasm]
script = "tar -czvf pkg.tar.gz pkg"
Expand All @@ -45,7 +49,7 @@ script = "cargo watch -w server -w msg -w consts -x 'run --bin rustgym-server'"
dependencies = ["wasm-pack"]

[tasks.sonic]
script = "sonic -c infra/config.cfg"
script = "sonic -c infra/sonic.cfg"

[tasks.dev]
run_task = { name = ["sonic", "watch-server", "watch-wasm"], parallel = true }
Expand All @@ -54,13 +58,6 @@ run_task = { name = ["sonic", "watch-server", "watch-wasm"], parallel = true }
command = "wasm-pack"
args = ["test", "--chrome", "--headless", "wasm"]

[tasks.tfrs-test]
script = "cargo test -p rustgym-tfrs"

[tasks.watch-tfrs-test]
run_task = { name = ["tfrs-test"] }
watch = { postpone = true, watch = ["./tfrs", "./tfrs-sys"] }

[tasks.build-mini]
command = "cargo"
args = [
Expand Down
Loading

0 comments on commit 4bdec0d

Please sign in to comment.