diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..ca79ca5b4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8835aad07..02cc2ac8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: # needs `opam exec --` as `dune` is not in the shell PATH opam exec -- dune fmt --preview - install-ubuntu: + ubuntu: runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -173,22 +173,29 @@ jobs: run: opam exec -- make all - name: Make Windows app run: | - opam exec -- make KappaBin + opam exec -- make KappappWin # Note: This runs powershell thus the different path syntax - mv .\build\KappaBin . + mv .\build\KappappWin . # Note: Windows VMs on GitHub Action do not have zip command but provide 7z - 7z a -tzip KappaBin.zip KappaBin + 7z a -tzip KappappWin.zip KappappWin - name: Archive Windows app uses: actions/upload-artifact@v4 with: name: windows path: | - KappaBin.zip + KappappWin.zip - deploy-docs: - needs: install-ubuntu - runs-on: ubuntu-22.04 + deploy: + needs: | + ubuntu + js + macos + windows if: github.ref == 'refs/heads/master' + runs-on: ubuntu-22.04 + strategy: + matrix: + deploy-name: [doc, online-ui, linux, macos, windows] steps: - name: Checkout uses: actions/checkout@v4 @@ -201,58 +208,4 @@ jobs: with: key: ${{ secrets.DEPLOY_KEY }} known_hosts: api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM= - - run: dev/update-web.sh native - - deploy-js: - needs: js - runs-on: ubuntu-22.04 - if: github.ref == 'refs/heads/master' - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Download js artifact - uses: actions/download-artifact@v4 - with: - name: js - - name: Install SSH Key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.DEPLOY_KEY }} - known_hosts: api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM= - - run: dev/update-web.sh js - - deploy-macos: - needs: macos - runs-on: ubuntu-22.04 - if: github.ref == 'refs/heads/master' - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Download MacOS artifact - uses: actions/download-artifact@v4 - with: - name: macos - - name: Install SSH Key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.DEPLOY_KEY }} - known_hosts: api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM= - - run: dev/update-web.sh MacOS - - deploy-windows: - needs: windows - runs-on: ubuntu-22.04 - if: github.ref == 'refs/heads/master' - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Download Windows artifact - uses: actions/download-artifact@v4 - with: - name: windows - - name: Install SSH Key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.DEPLOY_KEY }} - known_hosts: api.kappalanguage.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBJooIEJd6sgRL5JUKGqh9zB3Xla1MchqR8IWl7Nh9ahm9Ji6IwV9QSKG9YQEIHdJWxBk4UzbfRWGkDK9q1GggyM= - - run: dev/update-web.sh windows + - run: dev/upload-website.sh ${{matrix.deploy-name}} diff --git a/Makefile b/Makefile index f2816916f..39e269b33 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ endif .PHONY: all agents clean check build-tests doc clean_doc debug .PHONY: temp-clean-for-ignorant-that-clean-must-be-done-before-fetch .PHONY: profiling kappalib install-lib -.PHONY: Kappapp Kappapp.tar.gz KappaBin KappaBin.zip Kappapp.app +.PHONY: Kappapp Kappapp.tar.gz KappappWin KappappWin.zip Kappapp.app .PRECIOUS: $(SCRIPTSWITNESS) @@ -171,6 +171,7 @@ build/Kappapp: mkdir build/Kappapp/resources/bin cp _build/install/default/bin/* build/Kappapp/resources/bin/ +## Electron build for linux Kappapp: # make clean before to be sure things are rebuilt TODO improve? +$(MAKE) clean @@ -182,35 +183,36 @@ build/Kappapp.tar.gz: build/Kappapp Kappapp.tar.gz: build/Kappapp.tar.gz -build/KappaBin: - mkdir -p build/KappaBin +build/KappappWin: + mkdir -p build/KappappWin +$(MAKE) APP_EXT=local build/site/index.html dune build --only-packages kappa-library,kappa-binaries,kappa-agents FILE=$$(mktemp -t electronXXXX); \ curl -LsS -o $$FILE https://github.com/electron/electron/releases/download/v$(ELECTRON_VERSION)/electron-v$(ELECTRON_VERSION)-win32-x64.zip && \ - unzip $$FILE -d build/KappaBin - mv build/site build/KappaBin/resources/app - mv build/KappaBin/electron.exe build/KappaBin/Kappapp.exe - mkdir build/KappaBin/resources/bin - cp _build/default/core/main/KaSim.exe build/KappaBin/resources/bin/ - cp _build/default/core/KaSa_rep/main/KaSa.exe build/KappaBin/resources/bin/ - cp _build/default/core/agents/KaStor.exe build/KappaBin/resources/bin/ - cp _build/default/core/odes/KaDE.exe build/KappaBin/resources/bin/ - cp _build/default/core/agents/KappaSwitchman.exe build/KappaBin/resources/bin/ - cp _build/default/core/agents/KaMoHa.exe build/KappaBin/resources/bin/ - cp _build/default/core/agents/KaSimAgent.exe build/KappaBin/resources/bin/ - cp _build/default/core/agents/KaSaAgent.exe build/KappaBin/resources/bin/ - -KappaBin: + unzip $$FILE -d build/KappappWin + mv build/site build/KappappWin/resources/app + mv build/KappappWin/electron.exe build/KappappWin/Kappapp.exe + mkdir build/KappappWin/resources/bin + cp _build/default/core/main/KaSim.exe build/KappappWin/resources/bin/ + cp _build/default/core/KaSa_rep/main/KaSa.exe build/KappappWin/resources/bin/ + cp _build/default/core/agents/KaStor.exe build/KappappWin/resources/bin/ + cp _build/default/core/odes/KaDE.exe build/KappappWin/resources/bin/ + cp _build/default/core/agents/KappaSwitchman.exe build/KappappWin/resources/bin/ + cp _build/default/core/agents/KaMoHa.exe build/KappappWin/resources/bin/ + cp _build/default/core/agents/KaSimAgent.exe build/KappappWin/resources/bin/ + cp _build/default/core/agents/KaSaAgent.exe build/KappappWin/resources/bin/ + +## Electron build for windows +KappappWin: # make clean before to be sure things are rebuilt TODO improve? +$(MAKE) clean - +$(MAKE) build/KappaBin + +$(MAKE) build/KappappWin -build/KappaBin.zip: build/KappaBin - zip -y -r $@ build/KappaBin - rm -rf build/KappaBin +build/KappappWin.zip: build/KappappWin + zip -y -r $@ build/KappappWin + rm -rf build/KappappWin -KappaBin.zip: build/KappaBin.zip +KappappWin.zip: build/KappappWin.zip build/Kappapp.app: build/Info.plist build/Kappa.icns # do not call make clean here or deps will be erased @@ -227,6 +229,7 @@ build/Kappapp.app: build/Info.plist build/Kappa.icns mv build/Kappa.icns $@/Contents/Resources/ mv build/Info.plist $@/Contents/ +# Electron build for MacOS 10.15 Kappapp.app: # make clean before to be sure things are rebuilt TODO improve? +$(MAKE) clean @@ -254,3 +257,11 @@ build/Kappa.iconset: gui/resources/Kappa-Logo.png build/Kappa.icns: build/Kappa.iconset mkdir -p build iconutil -c icns $< + +.PHONY: Kappapp_for_linux Kappapp_for_macos10.15 Kappapp_for_windows + +Kappapp_for_linux: Kappapp + +Kappapp_for_macos10.15: Kappapp.app + +Kappapp_for_windows: KappappWin diff --git a/dev/update-web.sh b/dev/upload-website.sh similarity index 88% rename from dev/update-web.sh rename to dev/upload-website.sh index 9e254907a..3aaf2f291 100755 --- a/dev/update-web.sh +++ b/dev/upload-website.sh @@ -12,7 +12,7 @@ empty_or_create () PLAYGROUND=$(mktemp -d -t kappaXXXX) git clone --depth 10 --quiet -b master git@github.com:Kappa-Dev/Kappa-Dev.github.io.git ${PLAYGROUND} case $1 in - native ) + doc ) empty_or_create ${PLAYGROUND}/docs/KaSim-manual-${TRAVIS_BRANCH} cp man/*.htm man/*.css ${PLAYGROUND}/docs/KaSim-manual-${TRAVIS_BRANCH}/ cp man/KaSim_manual.pdf ${PLAYGROUND}/docs/KaSim-manual-${TRAVIS_BRANCH}.pdf @@ -29,7 +29,7 @@ case $1 in scp -r \ ${PLAYGROUND}/docs travis@api.kappalanguage.org:/var/www/tools.kappalanguage.org/ ;; - js ) + online-ui ) empty_or_create ${PLAYGROUND}/try cp site/* ${PLAYGROUND}/try/ sed '/<\/head>/i \ @@ -51,31 +51,33 @@ case $1 in ' site/index.html > ${PLAYGROUND}/try/index.html scp -o UserKnownHostsFile=dev/deploy_hosts -i dev/travis-deploy -r \ ${PLAYGROUND}/try travis@api.kappalanguage.org:/var/www/tools.kappalanguage.org/ + + # Upload /viz interface alongside /try empty_or_create ${PLAYGROUND}/viz cp viz/* ${PLAYGROUND}/viz/ scp -o UserKnownHostsFile=dev/deploy_hosts -i dev/travis-deploy -r \ ${PLAYGROUND}/viz travis@api.kappalanguage.org:/var/www/tools.kappalanguage.org/ + ;; + linux ) [ -d ${PLAYGROUND}/binaries ] || mkdir ${PLAYGROUND}/binaries - cp Kappapp.tar.gz ${PLAYGROUND}/binaries/ - scp ${PLAYGROUND}/binaries/Kappapp.tar.gz \ + cp Kappapp.tar.gz ${PLAYGROUND}/binaries/Kappapp_linux.tar.gz + scp ${PLAYGROUND}/binaries/Kappapp_linux.tar.gz \ travis@api.kappalanguage.org:/var/www/tools.kappalanguage.org/nightly-builds/ ;; - python ) - ;; - '' ) - ;; windows ) [ -d ${PLAYGROUND}/binaries ] || mkdir ${PLAYGROUND}/binaries - cp KappaBin.zip ${PLAYGROUND}/binaries/ - scp ${PLAYGROUND}/binaries/KappaBin.zip \ + cp KappappWin.zip ${PLAYGROUND}/binaries/Kappapp_windows.zip + scp ${PLAYGROUND}/binaries/Kappapp_windows.zip \ travis@api.kappalanguage.org:/var/www/tools.kappalanguage.org/nightly-builds/ ;; - MacOS ) + macos ) [ -d ${PLAYGROUND}/binaries ] || mkdir ${PLAYGROUND}/binaries - cp Kappapp.app.zip ${PLAYGROUND}/binaries/ - scp ${PLAYGROUND}/binaries/Kappapp.app.zip \ + cp Kappapp.app.zip ${PLAYGROUND}/binaries/Kappapp_macos10.15.app.zip + scp ${PLAYGROUND}/binaries/Kappapp_macos10.15.app.zip \ travis@api.kappalanguage.org:/var/www/tools.kappalanguage.org/nightly-builds/ ;; + '' ) + ;; esac COMMITNAME=$(git show --pretty=oneline -s --no-color) cd ${PLAYGROUND}