Skip to content

Commit

Permalink
Merge branch 'tw93:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
xhemj authored Nov 5, 2024
2 parents c0e0696 + 97a68ca commit 0421a21
Show file tree
Hide file tree
Showing 23 changed files with 551 additions and 232 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.gitignore

**/target
**/node_modules

**/*.log
**/*.md
**/tmp

Dockerfile
49 changes: 49 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -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-22.04
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
57 changes: 57 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
</td>
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/17dC9I.jpg width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/mc41xq.jpg width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/WeRead.jpg width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/Twitter.jpg width=600/></td>
</tr>
<tr>
<td>ChatGPT
Expand All @@ -60,8 +60,8 @@
</td>
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/5aO6yP.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/Ztsx23.png width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/ChatGPT.png width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/Poe.png width=600/></td>
</tr>
<tr>
<td>YouTube Music
Expand All @@ -76,8 +76,8 @@
</td>
</tr>
<tr>
<td><img src=https://raw.githubusercontent.com/tw93/static/master/pic/12.png width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/pn/1.jpg width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/YouTubeMusic.png width=600 /></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/YouTube.jpg width=600 /></td>
</tr>
<tr>
<td>LiZhi
Expand All @@ -92,8 +92,8 @@
</td>
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/nYEKqN.jpg width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/r7/0C9lju.jpg width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/LiZhi.jpg width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/ProgramMusic.jpg width=600/></td>
</tr>
<tr>
<td>Qwerty
Expand All @@ -108,8 +108,8 @@
</td>
</tr>
<tr>
<td><img src=https://cdn.fliggy.com/upic/i2eg6G.png width=600/></td>
<td><img src=https://cdn.fliggy.com/upic/mUzOek.jpg width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/Qwerty.png width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/CodeRunner.jpg width=600/></td>
</tr>
<tr>
<td>Flomo
Expand All @@ -124,8 +124,8 @@
</td>
</tr>
<tr>
<td><img src=https://gw.alipayobjects.com/zos/k/30/RoUSUf.png width=600/></td>
<td><img src=https://gw.alipayobjects.com/zos/k/89/yJVwyi.png width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/Flomo.png width=600/></td>
<td><img src=https://raw.githubusercontent.com/tw93/static/main/pake/XiaoHongShu.png width=600/></td>
</tr>
</table>

Expand Down Expand Up @@ -159,7 +159,7 @@ In addition, double-click the title bar to switch to full-screen mode. For Mac u

## Command-Line Packaging

![Pake](https://gw.alipayobjects.com/zos/k/zd/pake.gif)
![Pake](https://raw.githubusercontent.com/tw93/static/main/pake/pake.gif)

**Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README.md) for more information.**

Expand All @@ -172,6 +172,7 @@ 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

```

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.
Expand Down Expand Up @@ -371,6 +372,13 @@ 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"/>
Expand All @@ -385,13 +393,21 @@ Pake's development can not be without these Hackers. They contributed a lot of c
<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 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>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/houhoz">
<img src="https://avatars.githubusercontent.com/u/19684376?v=4" width="90;" alt="houhoz"/>
Expand All @@ -405,8 +421,7 @@ Pake's development can not be without these Hackers. They contributed a lot of c
<br />
<sub><b>Null</b></sub>
</a>
</td></tr>
<tr>
</td>
<td align="center">
<a href="https://github.com/liudonghua123">
<img src="https://avatars.githubusercontent.com/u/2276718?v=4" width="90;" alt="liudonghua123"/>
Expand Down
Loading

0 comments on commit 0421a21

Please sign in to comment.