-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Keldos-Li/dev/sass
补充文档,用 Makefile 替代 make.sh,改进文件结构 Former-commit-id: a2144a2
- Loading branch information
Showing
7 changed files
with
117 additions
and
80 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,25 @@ | ||
name: Dev Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev** | ||
|
||
jobs: | ||
compile: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install ruby sass -y | ||
- name: Compile | ||
run: | | ||
cd ./src; make | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: my-artifact | ||
path: | | ||
./src/latex-theme/*.zip |
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
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
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,53 @@ | ||
base_dir = $(shell pwd) | ||
|
||
target_dir = $(base_dir)/latex-theme | ||
working_dir = $(base_dir)/build | ||
windows = windows | ||
macos = macos | ||
linux = linux | ||
|
||
$(shell mkdir -p $(working_dir)) | ||
$(shell mkdir -p $(target_dir)) | ||
|
||
# $(1) is the name of operating system, $(2) is light or dark theme | ||
define build | ||
mkdir -p $(target_dir)/$(1) | ||
mkdir -p $(target_dir)/$(1)/target | ||
echo '$$theme: "$(2)";' >> $(working_dir)/$(1)-$(2).scss | ||
echo '$$os: "$(1)";' >> $(working_dir)/$(1)-$(2).scss | ||
cat $(base_dir)/latex-theme.scss >> $(working_dir)/$(1)-$(2).scss | ||
if [ "$(2)" = "light" ]; then \ | ||
scss --sourcemap=none $(working_dir)/$(1)-$(2).scss $(target_dir)/$(1)/target/latex.css; \ | ||
else \ | ||
scss --sourcemap=none $(working_dir)/$(1)-$(2).scss $(target_dir)/$(1)/target/latex-$(2).css; \ | ||
fi; | ||
endef | ||
|
||
# $(1) is the name of operating system | ||
define build-os | ||
$(call build,$(1),light) | ||
$(call build,$(1),dark) | ||
if [ "$(1)" = "$(windows)" ]; then \ | ||
cp $(base_dir)/install.ps1 $(target_dir)/$(1); \ | ||
else \ | ||
cp $(base_dir)/install.sh $(target_dir)/$(1); \ | ||
fi; | ||
cd $(target_dir)/$(1); zip -r $(target_dir)/latex-theme-$(1).zip ./* | ||
endef | ||
|
||
.PHONY: all | ||
all: | ||
make windows | ||
make macos | ||
|
||
.PHONY: windows | ||
windows: | ||
$(call build-os,$(windows)) | ||
|
||
.PHONY: macos | ||
macos: | ||
$(call build-os,$(macos)) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf $(target_dir) $(working_dir) |
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
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
This file was deleted.
Oops, something went wrong.