-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Bevy Assets to website
- Loading branch information
Showing
20 changed files
with
692 additions
and
60 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,21 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: "Build Bevy Assets" | ||
run: cd generate-assets && ./generate_assets.sh | ||
|
||
- name: "Build website" | ||
uses: shalzz/zola-deploy-action@master | ||
env: | ||
PAGES_BRANCH: gh-pages | ||
BUILD_DIR: . | ||
BUILD_ONLY: true | ||
TOKEN: fake-secret |
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,24 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: "Build Bevy Assets" | ||
run: cd generate-assets && ./generate_assets.sh | ||
|
||
- name: "Build and deploy website" | ||
uses: shalzz/zola-deploy-action@master | ||
env: | ||
PAGES_BRANCH: gh-pages | ||
BUILD_DIR: . | ||
TOKEN: ${{ secrets.CART_PAT }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
public | ||
**/.DS_Store | ||
.idea/ | ||
content/assets |
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,2 @@ | ||
target | ||
assets |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,16 @@ | ||
[package] | ||
name = "generate-assets" | ||
version = "0.1.0" | ||
authors = [ | ||
"Bevy Contributors <bevyengine@gmail.com>", | ||
"Carter Anderson <mcanders1@gmail.com>", | ||
] | ||
license = "MIT" | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
toml = "0.5" | ||
serde = { version = "1", features = [ "derive" ] } | ||
rand = "0.8" |
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 @@ | ||
#!/bin/sh | ||
|
||
git clone --branch bevy-asset https://github.com/bevyengine/awesome-bevy assets | ||
|
||
cargo run -- assets ../content |
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,42 @@ | ||
import re | ||
import os | ||
import sys | ||
|
||
name_fix = { | ||
'bevy_nbody': 'thallada-bevy_nbody', | ||
'bevy-nbody': 'WhoisDavid-bevy-nbody', | ||
} | ||
|
||
f = open(sys.argv[1] + "/README.md") | ||
lines = f.readlines() | ||
|
||
root_folder = sys.argv[2] + "/" | ||
os.mkdir(root_folder) | ||
|
||
category = None | ||
subcategory = None | ||
current_path = root_folder | ||
for line in lines: | ||
if line[0:3] == "## ": | ||
category = line.split("# ")[1][0:-1] | ||
current_path = root_folder + category | ||
os.mkdir(current_path) | ||
elif line[0:3] == "###": | ||
subcategory = line.split("# ")[1][0:-1] | ||
current_path = root_folder + category + "/" + subcategory | ||
os.mkdir(current_path) | ||
elif line[0:2] == "* ": | ||
line = line[0:-1] | ||
m = re.search('\* \[([^]]*)\]\(([^)]*)\)(: (.*))?', line) | ||
name = m.group(1) | ||
link = m.group(2) | ||
desc = m.group(4) | ||
if name in name_fix: | ||
name = name_fix[name] | ||
f = open(current_path + '/' + name.replace(' ', '-').replace('/', '-') + ".toml", "w") | ||
f.write("name = \"" + name + "\"\n") | ||
if desc is not None: | ||
f.write("description = \"" + desc.replace('"', '\'') + "\"\n") | ||
f.write("link = \"" + link + "\"\n") | ||
f.close() | ||
|
Oops, something went wrong.