Skip to content

Commit

Permalink
switched gh action for electron building
Browse files Browse the repository at this point in the history
  • Loading branch information
imolorhe committed Dec 9, 2024
1 parent 5d59e09 commit 8fb2a5e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/_publish-electron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ jobs:
with:
xcode-version: latest-stable
- run: pnpm i --frozen-lockfile
- name: Enable Corepack before setting up Node (temporary workaround for action-electron-builder which uses yarn and causes errors as it conflicts with pnpm https://github.com/yarnpkg/yarn/issues/9015)
run: corepack enable
- uses: nick-invision/retry@v2
with:
timeout_minutes: 20
Expand All @@ -94,12 +92,12 @@ jobs:
# disable for macos not in master branch, because code signing is skipped in pull requests
if: ${{ inputs.publish || !(startsWith(matrix.os, 'macos') && github.ref != 'refs/heads/master') }}
id: build-electron
uses: CryogenicPlanet/action-electron-builder@v2 # Using CryogenicPlanet until the main action adds skip_install
uses: paneron/action-electron-builder@v1.8.1
with:
github_token: ${{ secrets.github_token }}
package_root: packages/altair-electron/
skip_build: true
skip_install: true
skip_package_manager_install: true
mac_certs: ${{ secrets.mac_certs }}
mac_certs_password: ${{ secrets.mac_certs_password }}
args: ${{ inputs.publish && '--publish always' || '--publish never' }}
Expand Down
39 changes: 25 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,29 @@ RUN --mount=type=bind,source=package.json,target=package.json \

################################################################################
# Create a stage for building the application.
FROM deps AS build

COPY . .

# Download additional development dependencies before building, as some projects require
# "devDependencies" to be installed to build. If you don't need this, remove this step.
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
--mount=type=cache,target=/root/.local/share/pnpm/store \
pnpm install --frozen-lockfile
FROM base AS build
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run -r build
# RUN pnpm deploy --filter=app1 --prod /prod/app1
RUN pnpm deploy --filter=@altairgraphql/api /api-app
# FROM deps AS build

# Copy the rest of the source files into the image.
# COPY . .
# Run the build script.
RUN pnpm run build

# # Download additional development dependencies before building, as some projects require
# # "devDependencies" to be installed to build. If you don't need this, remove this step.
# RUN --mount=type=bind,source=package.json,target=package.json \
# --mount=type=bind,source=pnpm-lock.yaml,target=pnpm-lock.yaml \
# --mount=type=cache,target=/root/.local/share/pnpm/store \
# pnpm install --frozen-lockfile

# # Copy the rest of the source files into the image.
# # COPY . .
# # Run the build script.
# RUN pnpm run build

################################################################################
# Create a new stage to run the application with minimal runtime dependencies
Expand All @@ -67,14 +75,17 @@ ENV NODE_ENV=production
# Run the application as a non-root user.
USER node

COPY --from=build /api-app /app
WORKDIR /app

# Copy package.json so that package manager commands can be used.
COPY package.json .
# COPY package.json .

# Copy the production dependencies from the deps stage and also
# the built application from the build stage into the image.
# COPY --from=deps /usr/src/app/node_modules ./node_modules
# COPY --from=build /usr/src/app/dist ./dist
COPY --from=build /usr/src/app/ .
# COPY --from=build /usr/src/app/ .

ENV NEW_RELIC_NO_CONFIG_FILE=true
ENV NEW_RELIC_DISTRIBUTED_TRACING_ENABLED=true
Expand Down

0 comments on commit 8fb2a5e

Please sign in to comment.