-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from qlrd/main
Added minor updates; An error page with quit buttons; Show an error page when flash fail; A quit button when flash is done; A .rpm package for Fedora Linux And RedHat Linux based distros with x86_64/amd_64 architetures.
- Loading branch information
Showing
18 changed files
with
458 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Build electron application as deb package on linux (arm64) | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_PASSWORD: | ||
required: true | ||
token: | ||
required: true | ||
|
||
jobs: | ||
|
||
build-linux-deb-arm64: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_IMAGE: krux-installer-deb | ||
DOCKER_TARGET_PLATFORM: ubuntu/arm64/v8 | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Setup variables | ||
id: setup | ||
run: | | ||
echo "docker-platform=${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT | ||
echo "docker-image=${DOCKER_IMAGE}/${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT | ||
echo "docker-version=${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT | ||
KRUX_VERSION=`node -e "console.log(require('./package.json').version)"` | ||
echo "app-version=$KRUX_VERSION" >> $GITHUB_OUTPUT | ||
echo "app-name=krux-installer_${KRUX_VERSION}_arm64" >> $GITHUB_OUTPUT | ||
- name: Docker Login | ||
run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | ||
|
||
- name: Create release folder | ||
run: mkdir -p ./release/${{ steps.setup.outputs.app-version }} | ||
|
||
- name: Run Buildx | ||
run: | | ||
docker buildx build \ | ||
--file ./dockerfiles/deb/Dockerfile \ | ||
--platform ${{ steps.setup.outputs.docker-platform }} \ | ||
--tag ${{ steps.setup.outputs.docker-image }}:${{ steps.setup.outputs.docker-version }} \ | ||
--output type=local,dest=./release . | ||
- name: Hash electron app | ||
uses: qlrd/sha256sum-action@v2 | ||
with: | ||
working-directory: release/${{ steps.setup.outputs.app-version }} | ||
file: ${{ steps.setup.outputs.app-name }}.deb | ||
ext: sha256.txt | ||
|
||
- name: List releases | ||
run: ls ./release/${{ steps.setup.outputs.app-version }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ github.ref_name == 'main' }} | ||
with: | ||
name: ${{ runner.os }}-${{ steps.setup.outputs.app-name }}-deb | ||
retention-days: 5 | ||
path: | | ||
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.deb | ||
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.deb.sha256.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
|
||
build-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout Git repository | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Build electron application as rpm package on linux (arm64) | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKER_USERNAME: | ||
required: true | ||
DOCKER_PASSWORD: | ||
required: true | ||
token: | ||
required: true | ||
|
||
jobs: | ||
|
||
build-linux-rpm-arm64: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_IMAGE: krux-installer-rpm | ||
DOCKER_TARGET_PLATFORM: ubuntu/arm64/v8 | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Setup variables | ||
id: setup | ||
run: | | ||
echo "docker-platform=${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT | ||
echo "docker-image=${DOCKER_IMAGE}/${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT | ||
echo "docker-version=${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT | ||
KRUX_VERSION=`node -e "console.log(require('./package.json').version)"` | ||
echo "app-version=$KRUX_VERSION" >> $GITHUB_OUTPUT | ||
echo "app-name=krux-installer-${KRUX_VERSION}.aarch64" >> $GITHUB_OUTPUT | ||
- name: Docker Login | ||
run: echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin | ||
|
||
- name: Create release folder | ||
run: mkdir -p ./release/${{ steps.setup.outputs.app-version }} | ||
|
||
- name: Run Buildx | ||
run: | | ||
docker buildx build \ | ||
--file ./dockerfiles/rpm/Dockerfile \ | ||
--platform ${{ steps.setup.outputs.docker-platform }} \ | ||
--tag ${{ steps.setup.outputs.docker-image }}:${{ steps.setup.outputs.docker-version }} \ | ||
--output type=local,dest=./release . | ||
- name: Hash electron app | ||
uses: qlrd/sha256sum-action@v2 | ||
with: | ||
working-directory: release/${{ steps.setup.outputs.app-version }} | ||
file: ${{ steps.setup.outputs.app-name }}.rpm | ||
ext: sha256.txt | ||
|
||
- name: List releases | ||
run: ls ./release/${{ steps.setup.outputs.app-version }} | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ github.ref_name == 'main' }} | ||
with: | ||
name: ${{ runner.os }}-${{ steps.setup.outputs.app-name }}-rpm | ||
retention-days: 5 | ||
path: | | ||
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.rpm | ||
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.rpm.sha256.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Build electron application as rpm package on linux | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
token: | ||
required: true | ||
|
||
jobs: | ||
|
||
build-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install RPM dependencies | ||
run: sudo apt-get install rpm | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20.10.0" | ||
|
||
- name: Variables helpers | ||
id: setup | ||
run: | | ||
KRUX_VERSION=`node -e "console.log(require('./package.json').version)"` | ||
echo "app-version=$KRUX_VERSION" >> $GITHUB_OUTPUT | ||
KRUX_NAME=krux-installer | ||
echo "app-name=${KRUX_NAME}-${KRUX_VERSION}.x86_64" >> $GITHUB_OUTPUT | ||
echo "::group::Variables" | ||
echo "app-version=$KRUX_VERSION" | ||
echo "app-name=$KRUX_NAME" | ||
echo "::endgroup::" | ||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build electron app | ||
env: | ||
GH_TOKEN: ${{ secrets.token }} | ||
run: yarn run build --linux rpm | ||
|
||
- name: Hash electron app (Linux) | ||
uses: qlrd/sha256sum-action@v2 | ||
with: | ||
working-directory: ./release/${{ steps.setup.outputs.app-version }} | ||
file: ${{ steps.setup.outputs.app-name }}.rpm | ||
ext: sha256.txt | ||
|
||
- name: List release files | ||
run: | | ||
echo "::group::Release files" | ||
ls -la release/${{ steps.setup.outputs.app-version }} | ||
echo "::endgroup::" | ||
- name: Install xvfb-maybe to allow headless test | ||
run: yarn add --dev xvfb-maybe | ||
|
||
- name: E2E test electron app | ||
env: | ||
DEBUG: 'krux:*' | ||
run: ./node_modules/.bin/xvfb-maybe ./node_modules/.bin/wdio run wdio.conf.mts | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ github.ref_name == 'main' }} | ||
with: | ||
name: ${{ runner.os }}-${{ steps.setup.outputs.app-name }}-rpm | ||
retention-days: 5 | ||
path: | | ||
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.rpm | ||
release/${{ steps.setup.outputs.app-version }}/${{ steps.setup.outputs.app-name }}.rpm.sha256.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM arm64v8/node AS build-stage | ||
ENV NODE_ENV "test" | ||
ENV NODE_DOCKER true | ||
ENV DEBUG "krux:*" | ||
ENV USE_SYSTEM_FPM true | ||
ENV DOCUMENTS /app/Documents | ||
|
||
ADD . /app | ||
WORKDIR /app | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y \ | ||
libopenjp2-tools \ | ||
ruby \ | ||
ruby-dev | ||
|
||
RUN gem install fpm | ||
RUN yarn install | ||
RUN yarn run build --arm64 --linux deb | ||
#RUN apt-get install --fix-missing -y xvfb | ||
#RUN yarn add --dev xvfb-maybe | ||
#RUN node ./node_modules/.bin/xvfb-maybe \ | ||
# ./node_modules/.bin/wdio \ | ||
# run \ | ||
# wdio.conf.mts | ||
|
||
FROM scratch AS export-stage | ||
COPY --from=build-stage /app/release / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM arm64v8/node AS build-stage | ||
ENV NODE_ENV "test" | ||
ENV NODE_DOCKER true | ||
ENV DEBUG "krux:*" | ||
ENV USE_SYSTEM_FPM true | ||
ENV DOCUMENTS /app/Documents | ||
|
||
ADD . /app | ||
WORKDIR /app | ||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y \ | ||
libopenjp2-tools \ | ||
ruby \ | ||
ruby-dev \ | ||
rpm | ||
|
||
RUN gem install fpm | ||
RUN yarn install | ||
RUN yarn run build --arm64 --linux rpm | ||
#RUN apt-get install --fix-missing -y xvfb | ||
#RUN yarn add --dev xvfb-maybe | ||
#RUN node ./node_modules/.bin/xvfb-maybe \ | ||
# ./node_modules/.bin/wdio \ | ||
# run \ | ||
# wdio.conf.mts | ||
|
||
FROM scratch AS export-stage | ||
COPY --from=build-stage /app/release / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.