Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:

- name: Build and Package
shell: bash
run: make zip
run: |
export RELEASE_TAG=${{ steps.get_version.outputs.VERSION }}
make zip

- name: Release
uses: softprops/action-gh-release@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ webfrontend/FylrExampleCustomDataType.coffee.js
webfrontend/FylrExampleTransition.coffee.js
webfrontend/ExampleDetailSidebarPlugin.coffee.js
.DS_Store
build-info.json
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@ JS = webfrontend/FylrExample.js
PLUGIN_NAME = fylr_example
ZIP_NAME ?= $(PLUGIN_NAME).zip
BUILD_DIR = build
BUILD_INFO = build-info.json

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

all: build ## build all

build: clean code ## build all (creates build folder)
build: clean code buildinfojson ## build all (creates build folder)
mkdir -p $(BUILD_DIR)/$(PLUGIN_NAME)
cp manifest.master.yml $(BUILD_DIR)/$(PLUGIN_NAME)/manifest.yml
cp $(BUILD_INFO) $(BUILD_DIR)/$(PLUGIN_NAME)
cp -r server l10n fas_config customDataTypeUpdater $(BUILD_DIR)/$(PLUGIN_NAME)
# remove Go stuff
rm -rf $(BUILD_DIR)/$(PLUGIN_NAME)/server/extension/hello/*
cp -r server/extension/hello/*.exe $(BUILD_DIR)/$(PLUGIN_NAME)/server/extension/hello

mkdir -p $(BUILD_DIR)/$(PLUGIN_NAME)/webfrontend
cp -r $(JS) webfrontend/FylrExample.html webfrontend/*.css $(BUILD_DIR)/$(PLUGIN_NAME)/webfrontend
# for zip release: include Readme.md
cp README.md $(BUILD_DIR)/$(PLUGIN_NAME)/webfrontend

code: $(JS) go ## build Coffeescript + Go code

Expand All @@ -37,6 +41,7 @@ zip: build ## build zip file for publishing

clean: ## clean build files
rm -f $(JS)
rm -f ${BUILD_INFO}
rm -rf $(BUILD_DIR)
$(MAKE) -C server/extension/hello clean

Expand All @@ -47,3 +52,16 @@ ${JS}: $(subst .coffee,.coffee.js,${COFFEE_FILES})
%.coffee.js: %.coffee
coffee -b -p --compile "$^" > "$@" || ( rm -f "$@" ; false )

buildinfojson:
repo=`git remote get-url origin | sed -e 's/\.git$$//' -e 's#.*[/\\]##'` ;\
rev=`git show --no-patch --format=%H` ;\
lastchanged=`git show --no-patch --format=%ad --date=format:%Y-%m-%dT%T%z` ;\
builddate=`date +"%Y-%m-%dT%T%z"` ;\
release=$(if $(strip $(RELEASE_TAG)),'"$(RELEASE_TAG)"','null') ;\
echo '{' > ${BUILD_INFO} ;\
echo ' "repository": "'$$repo'",' >> ${BUILD_INFO} ;\
echo ' "rev": "'$$rev'",' >> ${BUILD_INFO} ;\
echo ' "release": '$$release',' >> ${BUILD_INFO} ;\
echo ' "lastchanged": "'$$lastchanged'",' >> ${BUILD_INFO} ;\
echo ' "builddate": "'$$builddate'"' >> ${BUILD_INFO} ;\
echo '}' >> ${BUILD_INFO}
Loading
Loading