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

Build and Publish wifi-connect-ui #566

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
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
50 changes: 50 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: package and draft GitHub release
# https://github.com/product-os/flowzone/tree/master/.github/actions
inputs:
json:
description: "JSON stringified object containing all the inputs from the calling workflow"
required: true
secrets:
description: "JSON stringified object containing all the secrets from the calling workflow"
required: true
variables:
description: "JSON stringified object containing all the variables from the calling workflow"
required: true

# --- custom environment
NODE_VERSION:
type: string
default: "20.x"

runs:
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.NODE_VERSION }}

- name: Install dependencies
shell: bash
run: |
cd ./ui
if [ -e package-lock.json ]; then
npm ci
rahul-thakoor marked this conversation as resolved.
Show resolved Hide resolved
else
npm i
fi

- name: Build wifi-connect-ui
shell: bash
run: |
cd ./ui
npm run build
tar --auto-compress -cvf wifi-connect-ui.tar.gz -C build .

- name: Upload artifacts
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4
with:
name: gh-release-wifi-connect-ui-${{ github.event.pull_request.head.sha || github.event.head_commit.id }}-${{ strategy.job-index }}
path: ./ui/wifi-connect-ui.tar.gz
7 changes: 6 additions & 1 deletion Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ RUN install_packages dnsmasq wireless-tools
# use latest version. If specific version is required, it should be provided as vX.Y.Z, e.g v4.11.37
ARG VERSION="latest"

# create /usr/src/app/ui directory where we will extract pre-built UI
WORKDIR /usr/src/app/ui

WORKDIR /usr/src/app

RUN \
Expand All @@ -29,7 +32,9 @@ RUN \
export URL_PARTIAL="download/${VERSION}" ; \
fi; \
curl -Ls "$BASE_URL/$URL_PARTIAL/wifi-connect-$BINARY_ARCH_NAME.tar.gz" \
| tar -xvz -C /usr/src/app/
| tar -xvz -C /usr/src/app/ &&\
curl -Ls "$BASE_URL/$URL_PARTIAL/wifi-connect-ui.tar.gz" \
| tar -xvz -C /usr/src/app/ui

COPY scripts/start.sh .

Expand Down
3 changes: 1 addition & 2 deletions ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/coverage

# production
# /build
/build

# misc
.DS_Store
Expand All @@ -26,4 +26,3 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

5 changes: 5 additions & 0 deletions ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"useTabs": true
}
19 changes: 0 additions & 19 deletions ui/build/asset-manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion ui/build/index.html

This file was deleted.

30 changes: 0 additions & 30 deletions ui/build/precache-manifest.96ed21ec05e3b25e96ee640119b0334b.js

This file was deleted.

39 changes: 0 additions & 39 deletions ui/build/service-worker.js

This file was deleted.

1 change: 0 additions & 1 deletion ui/build/static/css/2.c38cd9da.chunk.css

This file was deleted.

Binary file removed ui/build/static/favicon.png
Binary file not shown.
2 changes: 0 additions & 2 deletions ui/build/static/js/2.ef060f46.chunk.js

This file was deleted.

81 changes: 0 additions & 81 deletions ui/build/static/js/2.ef060f46.chunk.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion ui/build/static/js/main.2b22a9e9.chunk.js

This file was deleted.

1 change: 0 additions & 1 deletion ui/build/static/js/runtime-main.2a78626f.js

This file was deleted.

15 changes: 0 additions & 15 deletions ui/build/static/manifest.json

This file was deleted.

Loading
Loading