Skip to content

Commit

Permalink
riscv experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 22, 2024
1 parent 602229d commit 75ad103
Show file tree
Hide file tree
Showing 6 changed files with 1,663 additions and 1,287 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build Docker image (RISC-V)
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.riscv64
push: true
tags: ghcr.io/carelessdev/bots-gulag:${{ github.ref_name }},ghcr.io/carelessdev/bots-gulag:latest
platforms: linux/riscv64
cache-from: type=gha
cache-to: type=gha,mode=max

honami-gitops:
runs-on: ubuntu-latest
needs: docker-push
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Changelog before version 4 is not available.

## [4.1.0] - 2024-09-22

- chore: bump deps
- feat: riscv64 build

## [4.0.0] - 2023-12-30

- refactor: back to node 20 + pnpm
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ? Builder: Complile TypeScript to JS
# ? -------------------------

FROM node:20-alpine as builder
FROM node:20-alpine AS builder

WORKDIR /app

Expand All @@ -24,7 +24,7 @@ RUN pnpm build
# ? Deps-prod: Obtaining node_modules that contains just production dependencies
# ? -------------------------

FROM node:20-alpine as deps-prod
FROM node:20-alpine AS deps-prod

WORKDIR /app

Expand All @@ -37,9 +37,9 @@ RUN pnpm install --frozen-lockfile --prod
# ? Runner: Production to run
# ? -------------------------

FROM node:20-alpine as runner
FROM node:20-alpine AS runner

LABEL name "emu-ootori"
LABEL name="bots-gulag"

RUN corepack enable

Expand Down
64 changes: 64 additions & 0 deletions Dockerfile.riscv64
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Modified from https://github.com/kaogeek/kaogeek-discord-bot

# ? -------------------------
# ? Builder: Complile TypeScript to JS
# ? -------------------------

FROM alpine:3.20 AS node

RUN apk add --no-cache nodejs npm
RUN npm install -g corepack

FROM node AS builder

WORKDIR /app

COPY package.json pnpm-lock.yaml* ./

RUN corepack enable
RUN pnpm install --frozen-lockfile

# copy sources
COPY src ./src
COPY tsconfig.json ./

# compile
RUN pnpm build

# ? -------------------------
# ? Deps-prod: Obtaining node_modules that contains just production dependencies
# ? -------------------------

FROM node AS deps-prod

WORKDIR /app

COPY package.json pnpm-lock.yaml* ./

RUN corepack enable
RUN pnpm install --frozen-lockfile --prod

# ? -------------------------
# ? Runner: Production to run
# ? -------------------------

FROM node AS runner

LABEL name="bots-gulag"

RUN corepack enable

USER node
ENV NODE_ENV production
ENV ENVIRONMENT PRODUCTION

# copy all files from layers above
COPY package.json ./

# copy built files
COPY --chown=node:node --from=deps-prod /app/node_modules ./node_modules
COPY --chown=node:node --from=builder /app/dist ./dist

RUN pnpm --version

CMD ["pnpm", "start"]
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "bots-gulag",
"version": "4.0.0",
"version": "4.1.0",
"description": "Bots",
"repository": "https://github.com/CarelessDev/bots-gulag",
"type": "module",
"private": true,
"main": "dist/bot.js",
"packageManager": "pnpm@8.13.1",
"packageManager": "pnpm@9.11.0",
"scripts": {
"start": "node dist/bot.js",
"build": "tsc",
Expand All @@ -16,8 +16,8 @@
"dependencies": {
"chalk": "5.3.0",
"cocoa-discord": "3.1.0",
"discord.js": "14.14.1",
"zod": "3.22.4"
"discord.js": "14.16.2",
"zod": "3.23.8"
},
"devDependencies": {
"@leomotors/config": "0.11.0",
Expand Down
Loading

0 comments on commit 75ad103

Please sign in to comment.