Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build workflows #11

Merged
merged 3 commits into from
Oct 30, 2023
Merged
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
8 changes: 6 additions & 2 deletions .github/workflows/arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
sketch-paths: |
- nostrZapLamp
cli-compile-flags: |
- --warnings="none"
- --build-property
- build.partitions=min_spiffs
- --build-property
- upload.maximum_size=1966080
libraries: |
- name: WebSockets
- name: ArduinoJson
Expand All @@ -37,8 +43,6 @@ jobs:
- name: Nostr
# - name: QRCode
# - name: ESP32Ping
cli-compile-flags: |
- --warnings="none"

- uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" --generate-notes ./dist/$tag/nostrZapLamp.ino.bootloader.bin \
gh release create "$tag" --generate-notes ./build/nostrZapLamp.ino.bootloader.bin \
./build/nostrZapLamp.ino.bin ./build/nostrZapLamp.ino.partitions.bin

pages:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: copy main assets
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: build webinstaller
run: sh build-webinstaller.sh
- name: npm install
run: npm install
- name: vite build
run: npx vite build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
Expand Down
19 changes: 8 additions & 11 deletions build-webinstaller.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
#!/bin/sh
INSTALLER_PATH=./hardware-installer/src/firmware/esp32
REPO=https://github.com/lnbits/nostr-zap-lamp/releases/download
PROJECT_NAME=nostrZapLamp
REPO=https://github.com/lnbits/nostr-zap-lamp/releases/download
INSTALLER_PATH=./hardware-installer/src/firmware/esp32

git clone https://github.com/lnbits/hardware-installer
mkdir -p $INSTALLER_PATH

cp versions.json ./hardware-installer/src/versions.json
cp installer/config.js ./hardware-installer/src/config.js
cp installer/Hero.jsx ./hardware-installer/src/Hero.jsx

mkdir -p $INSTALLER_PATH
for version in $(jq -r '.versions[]' ./hardware-installer/src/versions.json); do
mkdir -p $INSTALLER_PATH/$version
wget $REPO/$version/bootloader.bin
mv bootloader.bin $INSTALLER_PATH/$version
wget $REPO/$version/boot_app0.bin
mv boot_app0.bin $INSTALLER_PATH/$version
wget $REPO/$version/$PROJECT_NAME.ino.bin
mv $PROJECT_NAME.ino.bin $INSTALLER_PATH/$version
wget $REPO/$version/$PROJECT_NAME.ino.partitions.bin
mv $PROJECT_NAME.ino.partitions.bin $INSTALLER_PATH/$version
wget $REPO/$version/$PROJECT_NAME.ino.bootloader.bin
mv $PROJECT_NAME.ino.bootloader.bin $INSTALLER_PATH/$version
done

cd hardware-installer
npm install
vite build
8 changes: 8 additions & 0 deletions installer/Hero.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const Hero = () => {
return (
<div id="hero">
<h1>Nostr Zap Lamp!!!!!</h1>
<h2>It also has a subline</h2>
</div>
);
};
46 changes: 46 additions & 0 deletions installer/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export const addressesAndFiles = [
{
address: "0x1000",
fileName: "nostrZapLamp.ino.bootloader.bin",
},
{
address: "0x8000",
fileName: "nostrZapLamp.ino.partitions.bin",
},
{
address: "0xE000",
fileName: "boot_app0.bin",
},
{
address: "0x10000",
fileName: "nostrZapLamp.ino.bin",
},
];

export const configPath = "elements.json";
export const elements = [
{
name: "ssid",
value: "",
label: "WiFi SSID",
type: "text",
},
{
name: "password",
value: "",
label: "WiFi Password",
type: "text",
},
{
name: "relay",
value: "",
label: "Nostr Relay URL",
type: "text",
},
{
name: "pubkey",
value: "",
label: "Nostr Public Key in hex",
type: "text",
},
];
Loading