调整Github Actions配置

This commit is contained in:
WindyMadman 2023-07-06 08:10:56 +00:00
parent 47332fc238
commit 378ddfcb12
17 changed files with 109 additions and 94 deletions

View File

@ -25,9 +25,9 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# Just re-grab cpanfile/install.pl/package.json from the online repo as codespaces' build context is super fucked and I don't get it at all
# Dropping copies of the files in the .devcontainer folder should also work, but I cba to duplicate my build files for this and symlinks aint working I hate computers
RUN wget -P /tools https://raw.githubusercontent.com/Difegue/LANraragi/dev/tools/cpanfile \
&& wget -P /tools https://raw.githubusercontent.com/Difegue/LANraragi/dev/tools/install.pl \
&& wget https://raw.githubusercontent.com/Difegue/LANraragi/dev/package.json
RUN wget -P /tools https://raw.githubusercontent.com/WindyCloudCute/LANraragi_Chinese/dev/tools/cpanfile \
&& wget -P /tools https://raw.githubusercontent.com/WindyCloudCute/LANraragi_Chinese/dev/tools/install.pl \
&& wget https://raw.githubusercontent.com/WindyCloudCute/LANraragi_Chinese/dev/package.json
RUN npm run lanraragi-installer install-full

4
.github/FUNDING.yml vendored
View File

@ -1,7 +1,7 @@
# These are supported funding model platforms
github: difegue
github: WindyCloudCute
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: lanraragi
ko_fi: LANraragi_Chinese
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel

View File

@ -9,7 +9,7 @@ assignees: ''
<!-- hol up senpai have you checked out the GH Discussions first ?
Your issue/idea might've already been reported by someone else! 🐱‍👤
https://github.com/Difegue/LANraragi/discussions
https://github.com/WindyCloudCute/LANraragi_Chinese/discussions
->
**Please describe your suggestion, and the problem it'd solve.**

View File

@ -1,8 +1,8 @@
FROM difegue/lanraragi:nightly
FROM windycloud/lanraragi_cn:dev
# Use the base LRR container to have a prepared test environment
LABEL "name"="lrr-test"
LABEL "maintainer"="Difegue <sugoi@cock.li>"
LABEL "maintainer"="windycloud <fengzi_re@qq.com>"
LABEL "version"="0.0.1"
LABEL "com.github.actions.name"="LANraragi Test Suite"

2
.github/holopin.yml vendored
View File

@ -1,4 +1,4 @@
organization: lanraragi
organization: LANraragi_Chinese
defaultSticker: clcv2m3k3787908igx3n92wd4
stickers:
- id: clekglig8137209kxga2do5jq

View File

@ -1,15 +1,14 @@
on: push
name: "Test Homebrew"
name: "测试软件在macos下的运行"
jobs:
testBrew:
name: Test Homebrew version
name: 测试dev版本
runs-on: macos-latest
steps:
- uses: actions/checkout@master
- name: Build and test bundled homebrew formula
- uses: actions/checkout@main
- name: 构建和测试包的homebrew套件
run: |
cd tools/build/homebrew
echo "Replacing commit hash in formula with current hash $(git rev-parse --verify HEAD)"
echo "将套件中的Hash替换为当前Hash $(git rev-parse --verify HEAD)"
sed -i.bck "s/COMMIT_HASH/$(git rev-parse --verify HEAD)/" Lanraragi.rb
brew install --force --verbose --build-from-source Lanraragi.rb
brew test --verbose Lanraragi.rb
brew install --force --verbose --build-from-source Lanraragi.rb & brew test --verbose Lanraragi.rb

View File

@ -4,66 +4,66 @@ on:
- dev
- test-builds
- actions-testing
name: Continuous Delivery
name: 持续交付
jobs:
buildNightlyDocker:
name: Build and Push Docker Image
name: 构建并提交Docker镜像
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/cache@v3
- uses: actions/checkout@main
- name: 设置 QEMU
uses: docker/setup-qemu-action@master
- name: 设置 Docker Buildx
uses: docker/setup-buildx-action@master
- uses: actions/cache@main
with:
path: /tmp/buildxcache
key: ${{ runner.os }}-docker-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-buildx-
- name: Docker Login
- name: Docker 登录
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin
- name: Build/Push Nightly Docker
- name: 构建/推送 LANraragi for Docker 每日构建
run: |
docker buildx build \
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \
--output "type=image,push=true" \
--tag difegue/lanraragi:nightly \
--tag windycloud/lanraragi_cn:dev \
--cache-from "type=local,src=/tmp/buildxcache" \
--cache-to "type=local,dest=/tmp/buildxcache" \
--file ./tools/build/docker/Dockerfile .
exportDockerRootFS:
name: Build and export Docker rootfs for Windows build
name: 为 Windows 构建构建并导出 Docker rootfs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker Build and export
- uses: actions/checkout@main
- name: Docker 构建和导出
run: |
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile --build-arg INSTALL_PARAMETER=-w .
docker create --name rootfs difegue/lanraragi
docker build -t windycloud/lanraragi_cn:dev -f ./tools/build/docker/Dockerfile --build-arg INSTALL_PARAMETER=-w .
docker create --name rootfs windycloud/lanraragi_cn:dev
docker export --output=package.tar rootfs
- name: Upload rootfs
uses: actions/upload-artifact@v1
- name: 上传 rootfs
uses: actions/upload-artifact@main
with:
name: package
path: package.tar
buildNightlyWSL:
name: Build Nightly Windows Package
name: 构建 Windows 包
needs: exportDockerRootFS
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Download package
uses: actions/download-artifact@v1
- uses: actions/checkout@main
- name: 下载包
uses: actions/download-artifact@main
with:
name: package
- name: Build MSI Installer
- name: 构建MSI安装程序
shell: powershell
run: |
[array]$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property installationpath
@ -76,8 +76,8 @@ jobs:
git submodule update
choco install nuget.commandline
./tools/build/windows/build.ps1
- name: Upload Installer
uses: actions/upload-artifact@v1
- name: 上传安装程序
uses: actions/upload-artifact@main
with:
name: LANraragi.msi
path: ./tools/build/windows/Karen/Setup/bin/LANraragi.msi

View File

@ -1,18 +1,18 @@
on: [push, pull_request]
name: "Continuous Integration \U0001F44C\U0001F440"
name: "持续集成 \U0001F44C\U0001F440"
jobs:
testSuite:
name: Run Test Suite and Perl Critic
name: 运行测试套件和 Perl Critic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Test Docker Build
- uses: actions/checkout@main
- name: 测试 Docker 构建
run: |
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile .
- name: LANraragi Test Suite
docker build -t windycloud/lanraragi_cn:dev -f ./tools/build/docker/Dockerfile .
- name: LANraragi测试套件
uses: ./.github/action-run-tests
- name: Perl Critic
uses: Difegue/action-perlcritic@master
uses: WindyCloudCute/action-perlcritic@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:

View File

@ -1,36 +1,36 @@
on:
release:
types: [published]
name: New Version Release
name: 新版本发布
jobs:
exportDockerRootFS:
name: Build and export Docker rootfs for Windows build
name: 构建和导出Windows构建的Docker rootfs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker Build and export
- uses: actions/checkout@main
- name: Docker 构建和导出
run: |
docker build -t difegue/lanraragi -f ./tools/build/docker/Dockerfile --build-arg INSTALL_PARAMETER=-w .
docker create --name rootfs difegue/lanraragi
docker build -t windycloud/lanraragi_cn -f ./tools/build/docker/Dockerfile --build-arg INSTALL_PARAMETER=-w .
docker create --name rootfs windycloud/lanraragi_cn
docker export --output=package.tar rootfs
- name: Upload rootfs
uses: actions/upload-artifact@v1
- name: 上传 rootfs
uses: actions/upload-artifact@main
with:
name: package
path: package.tar
buildReleaseWSL:
name: Build Windows Installer
name: 构建Windows安装程序
needs: exportDockerRootFS
runs-on: windows-latest
steps:
- uses: actions/checkout@master
- name: Download package
uses: actions/download-artifact@v1
- uses: actions/checkout@main
- name: 下载包
uses: actions/download-artifact@main
with:
name: package
- name: Build MSI Installer
- name: 构建MSI安装程序
shell: powershell
run: |
[array]$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -property installationpath
@ -43,21 +43,22 @@ jobs:
git submodule update
choco install nuget.commandline
./tools/build/windows/build.ps1
- name: Upload Installer
uses: actions/upload-artifact@v1
- name: 上传安装程序
uses: actions/upload-artifact@main
with:
name: wsl
path: ./tools/build/windows/Karen/Setup/bin/LANraragi.msi
uploadWSLRelease:
name: Add Windows Installer to release
name: 添加Windows安装程序以发布
needs: buildReleaseWSL
runs-on: ubuntu-latest
steps:
- name: Download package
uses: actions/download-artifact@v1
- name: 下载包
uses: actions/download-artifact@main
with:
name: wsl
- name: Upload Installer to release
- name: 上传安装程序以发布
uses: JasonEtco/upload-to-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -70,34 +71,34 @@ jobs:
args: 'Windows Installer built and available on the Release page! <:logo:821516019179978772>🪟'
buildLatestDocker:
name: Build Latest Docker image
name: 构建最新的Docker图像
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- uses: actions/cache@v3
- uses: actions/checkout@main
- name: 设置 QEMU
uses: docker/setup-qemu-action@master
- name: 设置 Docker Buildx
uses: docker/setup-buildx-action@master
- uses: actions/cache@main
with:
path: /tmp/buildxcache
key: ${{ runner.os }}-docker-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-buildx-
- name: Docker Login
- name: Docker登录
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin
- name: Build/Push Latest Docker image and tag with Release number
- name: 构建/推送最新的 Docker 镜像和带有版本号的标签
run: |
TAG=${GITHUB_REF:10:10}
docker buildx build \
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 \
--output "type=image,push=true" \
--tag difegue/lanraragi:latest \
--tag difegue/lanraragi:$TAG \
--tag windycloud/lanraragi_cn:latest \
--tag windycloud/lanraragi_cn:$TAG \
--cache-from "type=local,src=/tmp/buildxcache" \
--cache-to "type=local,dest=/tmp/buildxcache" \
--file ./tools/build/docker/Dockerfile .
@ -108,19 +109,19 @@ jobs:
args: 'Docker image built and available on Docker Hub! 🐳'
discordNotifications:
name: Send out some notifications
name: 发布一些通知
runs-on: ubuntu-latest
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
steps:
- name: Extract version number from GITHUB_REF
- name: 从 GITHUB_REF 中提取版本号
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- uses: Ilshidur/action-discord@master
with:
args: 'LANraragi {{ RELEASE_VERSION }} is now available! @everyone'
- uses: Ilshidur/action-discord@master
with:
args: 'https://github.com/Difegue/LANraragi/releases/tag/{{ RELEASE_VERSION }}'
args: 'https://github.com/WindyCloudCute/LANraragi_Chinese/releases/tag/{{ RELEASE_VERSION }}'
- uses: Ilshidur/action-discord@master
with:
args: 'Docker image and Windows installer are building... Please wait warmly. ☕'

2
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "tools/build/windows/Karen"]
path = tools/build/windows/Karen
url = https://github.com/Difegue/Karen.git
url = https://github.com/WindyCloudCute/Karen

View File

@ -18,14 +18,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Difegue/LANraragi.git"
"url": "git+https://github.com/WindyCloudCute/LANraragi_Chinese"
},
"author": "dfug",
"license": "MIT",
"bugs": {
"url": "https://github.com/Difegue/LANraragi/issues"
"url": "https://github.com/WindyCloudCute/LANraragi_Chinese/issues"
},
"homepage": "https://github.com/Difegue/LANraragi#readme",
"homepage": "https://github.com/WindyCloudCute/LANraragi_Chinesei#readme",
"dependencies": {
"@fortawesome/fontawesome-free": "^6.2.1",
"@jcubic/tagger": "^0.4.2",

View File

@ -3,7 +3,7 @@
use strict;
use warnings;
use Cwd 'abs_path';
use open ':std', ':encoding(UTF-8)';
use Mojo::Base -strict;
use Mojo::Server::Morbo;
use Mojo::Server::Prefork;

View File

@ -27,6 +27,21 @@
</td>
</tr>
<tr>
<td class="option-td">
<h2 class="ih"> Use JPEG XL for thumbnails </h2>
</td>
<td class="config-td">
[% IF jxlthumbpages %]
<input id="jxlthumbpages" name="jxlthumbpages" class="fa" type="checkbox" checked> [% ELSE %]
<input id="jxlthumbpages" name="jxlthumbpages" class="fa" type="checkbox"> [% END %]
<label for="jxlthumbpages">
<br>Lanraragi出于兼容和性能原因生成JPEG缩略图。
<br>如果检查了此选项则将使用JPEG XL生成缩略图。
</label>
</td>
</tr>
<tr>
<td class="option-td">
<input id="genthumb-button" class='stdbtn' type='button' value='生成缺少的缩略图' />

View File

@ -1,6 +1,6 @@
# DOCKER-VERSION 0.3.4
FROM alpine:3.18
LABEL git="https://github.com/Difegue/LANraragi"
LABEL git="https://github.com/WindyCloudCute/LANraragi_Chinese"
ARG INSTALL_PARAMETER
ENV S6_KEEP_ENV 1

View File

@ -1,6 +1,6 @@
# DOCKER-VERSION 0.3.4
FROM alpine:3.12.12
LABEL git="https://github.com/Difegue/LANraragi"
LABEL git="https://github.com/WindyCloudCute/LANraragi_Chinese"
ENV S6_KEEP_ENV 1

View File

@ -2,15 +2,15 @@ require "language/node"
class Lanraragi < Formula
desc "Web application for archival and reading of manga/doujinshi"
homepage "https://github.com/Difegue/LANraragi"
# url "https://github.com/Difegue/LANraragi/archive/v.0.7.6.tar.gz"
homepage "https://github.com/WindyCloudCute/LANraragi_Chinese"
# url "https://github.com/WindyCloudCute/LANraragi_Chinese/archive/v.0.7.6.tar.gz"
# sha256 "2c498cc6a18b9fbb77c52ca41ba329c503aa5d4ec648075c3ebb72bfa7102099"
url "https://github.com/Difegue/LANraragi.git",
url "https://github.com/WindyCloudCute/LANraragi_Chinese.git",
revision: "COMMIT_HASH"
version "0.1994-dev"
license "MIT"
revision 1
head "https://github.com/Difegue/LANraragi.git"
head "https://github.com/WindyCloudCute/LANraragi_Chinese.git"
depends_on "nettle" => :build
depends_on "pkg-config" => :build
@ -122,6 +122,6 @@ class Lanraragi < Formula
EOS
# Execute through npm to avoid starting a redis-server
return_value = OS.mac? ? 61 : 111
assert_match output, shell_output("npm start --prefix #{libexec}", return_value)
assert_match output, shell_output("npm test --prefix #{libexec}", return_value)
end
end

View File

@ -9,7 +9,7 @@ echo "Version is $version"
$env:LRR_VERSION_NUM=$version
# Use Docker image
mv .\package\package.tar .\tools\build\windows\Karen\External\package.tar
Move-Item .\package.tar .\tools\build\windows\Karen\External\package.tar
# Use Karen master
cd .\tools\build\windows\Karen