Skip to content

Commit

Permalink
fix: build workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Oct 30, 2023
1 parent e773e49 commit 2896d51
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 13 deletions.
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",
},
];

0 comments on commit 2896d51

Please sign in to comment.