-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Build Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
env: | ||
RELEASE_ZIP_FILENAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip | ||
RELEASE_TAR_GZ_FILENAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.tar.gz | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | ||
with: | ||
node-version: '18.19.x' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: "Build Changelog" | ||
id: build_changelog | ||
uses: requarks/changelog-action@4a2c34a1a8fcfa9e48e61960aad0affc15066393 | ||
with: | ||
tag: ${{ github.ref_name }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
writeToFile: false | ||
includeInvalidCommits: true | ||
|
||
- name: Create Zip Archive | ||
run: | | ||
echo "::start:: Creating zip archive..." | ||
(cd dist && \ | ||
zip \ | ||
-r ../$RELEASE_ZIP_FILENAME . \ | ||
-x "node_modules/*" "*/node_modules/*" \ | ||
$(test -f ../.releaseignore && echo "-x@../.releaseignore")\ | ||
) | ||
echo "::end:: Created zip archive." | ||
- name: Create Tar Gz Archive | ||
run: | | ||
echo "::start:: Creating tar.gz archive..." | ||
(cd dist && \ | ||
tar \ | ||
-czv -f ../$RELEASE_TAR_GZ_FILENAME \ | ||
--exclude "node_modules/*" \ | ||
--exclude "*/node_modules/*" \ | ||
$(test -f ../.releaseignore && echo "--exclude-from ../.releaseignore") \ | ||
. | ||
) | ||
echo "::end:: Created tar.gz archive." | ||
- name: "Generate build number" | ||
id: generate_build_number | ||
uses: onyxmueller/build-tag-number@4a0c81c9af350d967032d49204c83c38e6b0c8e4 | ||
with: | ||
token: ${{secrets.github_token}} | ||
|
||
- name: "Create Kiosk Pro version file" | ||
id: create_kiosk_pro_version_file | ||
uses: IMAGINARY/kiosk-pro-version-file-action@1f8f5671ccc7617998e5468aff5e89854bf10e3e | ||
with: | ||
version: ${{ steps.generate_build_number.outputs.build_number }} | ||
zip: ${{ env.RELEASE_ZIP_FILENAME }} | ||
clear-previous-content: 'true' | ||
|
||
- name: Create the release | ||
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981 | ||
with: | ||
files: | | ||
${{ env.RELEASE_ZIP_FILENAME }} | ||
${{ env.RELEASE_TAR_GZ_FILENAME }} | ||
${{ steps.create_kiosk_pro_version_file.outputs.filepath }} | ||
body: ${{ steps.build_changelog.outputs.changes }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
# Run on pushes to the default branch | ||
push: | ||
branches: | ||
- main | ||
|
||
# ... Also run manually | ||
workflow_dispatch: | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
# Default to bash | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
permissions: | ||
contents: write | ||
pull-requests: read | ||
env: | ||
INPUT_PATH: "dist/" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | ||
with: | ||
node-version: '18.19.x' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Fix permissions | ||
run: | | ||
chmod -c -R +rX "$INPUT_PATH" | while read line; do | ||
echo "::warning title=Invalid file permissions automatically fixed::$line" | ||
done | ||
- name: Archive artifact | ||
shell: sh | ||
run: | | ||
echo ::group::Archive artifact | ||
tar \ | ||
--dereference --hard-dereference \ | ||
--directory "$INPUT_PATH" \ | ||
-cvf "$RUNNER_TEMP/artifact.tar" \ | ||
--exclude=.git \ | ||
--exclude=.github \ | ||
--exclude=*/node_modules/* \ | ||
--exclude=node_modules/* \ | ||
$(test -f ../.releaseignore && echo "--exclude-from=../.releaseignore") \ | ||
. | ||
echo ::endgroup:: | ||
env: | ||
INPUT_PATH: ${{ env.INPUT_PATH }} | ||
|
||
- name: Upload artifact | ||
id: upload-artifact | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 | ||
with: | ||
name: github-pages | ||
path: ${{ runner.temp }}/artifact.tar | ||
retention-days: 1 | ||
if-no-files-found: error | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 10 | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/dist | ||
/work | ||
node_modules | ||
!**/.gitkeep |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
# futurium-suitcase-gradient-descent | ||
|
||
Gradient Descent as a suitcase exhibit for Futurium | ||
|
||
## Building | ||
|
||
Requires Node.js (v18.19 or greater) and npm. | ||
|
||
Run the following from the root directory of the project: | ||
|
||
```bash | ||
npm install | ||
npm run build | ||
``` | ||
|
||
This will create a `dist` directory with the compiled exhibit. This directory can be served by any web server. | ||
|
||
## Credits | ||
|
||
This adaptation was developed by Eric Londaits for Imaginary gGmbH. | ||
|
||
## License | ||
|
||
Code licensed under the MIT License. See [LICENSE](LICENSE) for details. | ||
|
||
Copyright 2024 Imaginary gGmbH. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"defaultLanguage": "de", | ||
"languages": ["de", "en"], | ||
"useGamepads": true, | ||
"useScreenControls": false, | ||
"useKeyboardControls": true, | ||
"maxPlayers": 2, | ||
"maxTime": 100, | ||
"maxProbes": 10, | ||
"maxDepthTilt": 4, | ||
"continuousGame": false, | ||
"fullScreenButton": false, | ||
"languageButton": true, | ||
"debugControls": false, | ||
"showBotTypeTips": true, | ||
"showDemo": true, | ||
"demoDuration": 30000, | ||
"debugLog": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "futurium-suitcase-gradient-descent", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"dependencies": { | ||
"degit": "^2.8.4" | ||
}, | ||
"scripts": { | ||
"build": "rm -rf ./dist && degit github:IMAGINARY/gradient-descent#v1.8.3 --force dist && cp -R ./extras/. ./dist/. && cd ./dist/src && npm install && npm run build && cd .. && cd .." | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/IMAGINARY/futurium-suitcase-gradient-descent.git" | ||
}, | ||
"private": true | ||
} |