Merge branch 'master' of https://github.com/tw93/Pake
This commit is contained in:
11
.dockerignore
Normal file
11
.dockerignore
Normal file
@@ -0,0 +1,11 @@
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
**/target
|
||||
**/node_modules
|
||||
|
||||
**/*.log
|
||||
**/*.md
|
||||
**/tmp
|
||||
|
||||
Dockerfile
|
||||
49
.github/workflows/docker-publish.yml
vendored
Normal file
49
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: Build and Publish Docker Image
|
||||
|
||||
on:
|
||||
workflow_dispatch: # Manual
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=sha
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64,linux/arm64
|
||||
57
Dockerfile
Normal file
57
Dockerfile
Normal file
@@ -0,0 +1,57 @@
|
||||
# syntax=docker/dockerfile:1.4
|
||||
# Cargo build stage
|
||||
FROM rust:1.80-slim AS cargo-builder
|
||||
# Install Rust dependencies
|
||||
RUN --mount=type=cache,target=/var/cache/apt \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
libdbus-1-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev \
|
||||
libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev \
|
||||
libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev \
|
||||
gnome-video-effects
|
||||
COPY . /pake
|
||||
WORKDIR /pake/src-tauri
|
||||
# Build cargo packages and store cache
|
||||
RUN --mount=type=cache,target=/usr/local/cargo/registry \
|
||||
cargo fetch && \
|
||||
cargo build --release && \
|
||||
mkdir -p /cargo-cache && \
|
||||
cp -R /usr/local/cargo/registry /cargo-cache/ && \
|
||||
cp -R /usr/local/cargo/git /cargo-cache/
|
||||
|
||||
# Verify the content of /cargo-cache && clean unnecessary files
|
||||
RUN ls -la /cargo-cache/registry && ls -la /cargo-cache/git && rm -rfd /cargo-cache/registry/src
|
||||
|
||||
# Main build stage
|
||||
FROM rust:1.80-slim AS builder
|
||||
# Install Rust dependencies
|
||||
RUN --mount=type=cache,target=/var/cache/apt \
|
||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
libdbus-1-dev libsoup2.4-dev libjavascriptcoregtk-4.0-dev \
|
||||
libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev \
|
||||
libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev \
|
||||
gnome-video-effects
|
||||
|
||||
# Install Node.js 20.x
|
||||
RUN --mount=type=cache,target=/var/cache/apt \
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
||||
apt-get update && apt-get install -y nodejs
|
||||
|
||||
# Copy project files
|
||||
COPY . /pake
|
||||
WORKDIR /pake
|
||||
|
||||
# Copy Rust build artifacts
|
||||
COPY --from=cargo-builder /pake/src-tauri /pake/src-tauri
|
||||
COPY --from=cargo-builder /cargo-cache/git /usr/local/cargo/git
|
||||
COPY --from=cargo-builder /cargo-cache/registry /usr/local/cargo/registry
|
||||
|
||||
# Install dependencies and build pake-cli
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm install && \
|
||||
npm run cli:build
|
||||
|
||||
# Set up the entrypoint
|
||||
WORKDIR /output
|
||||
ENTRYPOINT ["node", "/pake/cli.js"]
|
||||
63
README.md
63
README.md
@@ -172,6 +172,18 @@ pake url [OPTIONS]...
|
||||
|
||||
# Feel free to play with Pake! It might take a while to prepare the environment the first time you launch Pake.
|
||||
pake https://weekly.tw93.fun --name Weekly --hide-title-bar
|
||||
|
||||
# On Linux, you can run the Pake CLI via Docker
|
||||
docker run -it --rm \ # Run interactively, remove container after exit
|
||||
-v YOUR_DIR:/output \ # Files from container's /output will be in YOU_DIR
|
||||
ghcr.io/tw93/pake \
|
||||
<arguments>
|
||||
|
||||
# For example:
|
||||
docker run -it --rm \
|
||||
-v ./packages:/output \
|
||||
ghcr.io/tw93/pake \
|
||||
https://example.com --name myapp --icon ./icon.png
|
||||
```
|
||||
|
||||
If you are new to the command line, you can compile packages online with _GitHub Actions_. See the [Tutorial](<https://github.com/tw93/Pake/wiki/Online-Compilation-(used-by-ordinary-users)>) for more information.
|
||||
@@ -292,12 +304,34 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
||||
<sub><b>Ikko Eltociear Ashimine</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/mattbajorek">
|
||||
<img src="https://avatars.githubusercontent.com/u/17235301?v=4" width="90;" alt="mattbajorek"/>
|
||||
<br />
|
||||
<sub><b>Matt Bajorek</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/QingZ11">
|
||||
<img src="https://avatars.githubusercontent.com/u/38887077?v=4" width="90;" alt="QingZ11"/>
|
||||
<br />
|
||||
<sub><b>Steam</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Tianj0o">
|
||||
<img src="https://avatars.githubusercontent.com/u/68584284?v=4" width="90;" alt="Tianj0o"/>
|
||||
<br />
|
||||
<sub><b>Qitianjia</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/xinyii">
|
||||
<img src="https://avatars.githubusercontent.com/u/17895104?v=4" width="90;" alt="xinyii"/>
|
||||
<br />
|
||||
<sub><b>Yi Xin</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/exposir">
|
||||
@@ -305,8 +339,7 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
||||
<br />
|
||||
<sub><b>孟世博</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/2nthony">
|
||||
<img src="https://avatars.githubusercontent.com/u/19513289?v=4" width="90;" alt="2nthony"/>
|
||||
@@ -334,7 +367,8 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
||||
<br />
|
||||
<sub><b>An Li</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nekomeowww">
|
||||
<img src="https://avatars.githubusercontent.com/u/11081491?v=4" width="90;" alt="nekomeowww"/>
|
||||
@@ -355,8 +389,7 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
||||
<br />
|
||||
<sub><b>Fechin</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ImgBotApp">
|
||||
<img src="https://avatars.githubusercontent.com/u/31427850?v=4" width="90;" alt="ImgBotApp"/>
|
||||
@@ -371,13 +404,6 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
||||
<sub><b>Jiaqi Gu</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/mattbajorek">
|
||||
<img src="https://avatars.githubusercontent.com/u/17235301?v=4" width="90;" alt="mattbajorek"/>
|
||||
<br />
|
||||
<sub><b>Matt Bajorek</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Milo123459">
|
||||
<img src="https://avatars.githubusercontent.com/u/50248166?v=4" width="90;" alt="Milo123459"/>
|
||||
@@ -391,22 +417,15 @@ Pake's development can not be without these Hackers. They contributed a lot of c
|
||||
<br />
|
||||
<sub><b>Po Chen</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Tianj0o">
|
||||
<img src="https://avatars.githubusercontent.com/u/68584284?v=4" width="90;" alt="Tianj0o"/>
|
||||
<br />
|
||||
<sub><b>Qitianjia</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</td></tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/geekvest">
|
||||
<img src="https://avatars.githubusercontent.com/u/126322776?v=4" width="90;" alt="geekvest"/>
|
||||
<br />
|
||||
<sub><b>Null</b></sub>
|
||||
</a>
|
||||
</td></tr>
|
||||
<tr>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/houhoz">
|
||||
<img src="https://avatars.githubusercontent.com/u/19684376?v=4" width="90;" alt="houhoz"/>
|
||||
|
||||
Reference in New Issue
Block a user