Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit cd75bf1

Browse files
author
OpenList Syncer
committed
Sync: sync the newest OpenList 2025-07-07
1 parent 9e610af commit cd75bf1

File tree

5 files changed

+347
-115
lines changed

5 files changed

+347
-115
lines changed

.github/workflows/daily.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build for Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
strategy:
15+
matrix:
16+
platform: [ubuntu-latest]
17+
target:
18+
- darwin-amd64
19+
- darwin-arm64
20+
- windows-amd64
21+
- linux-arm64-musl
22+
- linux-amd64-musl
23+
- windows-arm64
24+
- android-arm64
25+
name: Build
26+
runs-on: ${{ matrix.platform }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Get short SHA
32+
uses: benjlevesque/short-sha@v3.0
33+
id: short-sha
34+
35+
- name: Setup Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version: '1.22'
39+
40+
- name: Setup web
41+
run: bash build.sh dev web
42+
43+
- name: Build binaries
44+
uses: go-cross/cgo-actions@v1
45+
with:
46+
targets: ${{ matrix.target }}
47+
musl-target-format: $os-$musl-$arch
48+
out-dir: build
49+
x-flags: |
50+
github.com/alist-org/alist/v3/internal/conf.BuiltAt=$built_at
51+
github.com/alist-org/alist/v3/internal/conf.GitAuthor=Xhofe
52+
github.com/alist-org/alist/v3/internal/conf.GitCommit=$git_commit
53+
github.com/alist-org/alist/v3/internal/conf.Version=$tag
54+
github.com/alist-org/alist/v3/internal/conf.WebVersion=dev
55+
56+
- name: Upload artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: openlist_${{ steps.short-sha.outputs.sha }}_${{ matrix.target }}
60+
path: build/*
61+
62+
create-release:
63+
name: Create Release
64+
runs-on: ubuntu-latest
65+
needs: build
66+
permissions:
67+
contents: write
68+
steps:
69+
- name: Generate UTC timestamp
70+
id: timestamp
71+
run: |
72+
UTC_TIME=$(date -u +'%Y-%m-%d %H:%M')
73+
TAG_NAME=$(date -u +'build-%Y%m%d-%H%M')
74+
echo "date=$UTC_TIME" >> $GITHUB_OUTPUT
75+
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
76+
77+
- name: Download artifacts
78+
uses: actions/download-artifact@v4
79+
with:
80+
path: artifacts
81+
82+
- name: Create Release
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
tag_name: ${{ steps.timestamp.outputs.tag }}
86+
name: "Build @ ${{ steps.timestamp.outputs.date }} UTC"
87+
body: |
88+
Automated build release
89+
- Generated at **${{ steps.timestamp.outputs.date }} UTC**
90+
draft: false
91+
prerelease: false
92+
files: |
93+
artifacts/**/*

.github/workflows/docker.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Daily Docker AIO Build
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *' # 每天UTC时间0:00运行
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
ORG_NAME: ilovescratch2 # 全部小写
14+
IMAGE_NAME: openlistbuilder
15+
REGISTRY: ghcr.io
16+
ARTIFACT_NAME: 'daily_binaries'
17+
RELEASE_PLATFORMS: 'linux/amd64,linux/arm64'
18+
19+
jobs:
20+
build_binary:
21+
name: Build Binaries
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version: 'stable'
31+
32+
- name: Cache Musl libraries
33+
id: cache-musl
34+
uses: actions/cache@v4
35+
with:
36+
path: build/musl-libs
37+
key: daily-musl-${{ hashFiles('build.sh') }}-v3
38+
39+
- name: Download Musl (if not cached)
40+
if: steps.cache-musl.outputs.cache-hit != 'true'
41+
run: bash build.sh prepare docker-multiplatform
42+
43+
- name: Build Daily Binary
44+
run: bash build.sh beta docker-multiplatform
45+
46+
- name: Upload Artifacts
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: ${{ env.ARTIFACT_NAME }}
50+
path: |
51+
build/
52+
!build/*.tgz
53+
!build/musl-libs/**
54+
55+
build_and_push_aio:
56+
needs: build_binary
57+
name: Build and Push AIO Image
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Get current UTC timestamp
61+
id: timestamp
62+
run: |
63+
# 生成完全兼容的 Docker 标签格式
64+
TIMESTAMP=$(date -u +'%Y%m%d-%H%M%S')
65+
echo "TAG=openlistbuilder-$TIMESTAMP" >> $GITHUB_OUTPUT
66+
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_OUTPUT
67+
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Download Binaries
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: ${{ env.ARTIFACT_NAME }}
75+
path: build/
76+
77+
- name: Set up QEMU
78+
uses: docker/setup-qemu-action@v3
79+
80+
- name: Set up Docker Buildx
81+
uses: docker/setup-buildx-action@v3
82+
with:
83+
driver: docker-container
84+
driver-opts: network=host
85+
86+
- name: Login to GitHub Container Registry
87+
uses: docker/login-action@v3
88+
with:
89+
registry: ${{ env.REGISTRY }}
90+
username: ${{ github.actor }}
91+
password: ${{ secrets.GITHUB_TOKEN }}
92+
93+
- name: Build and Push AIO Image
94+
uses: docker/build-push-action@v6
95+
with:
96+
context: .
97+
file: Dockerfile.ci
98+
push: true
99+
build-args: |
100+
INSTALL_FFMPEG=true
101+
INSTALL_ARIA2=true
102+
tags: |
103+
${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.TAG }}
104+
platforms: ${{ env.RELEASE_PLATFORMS }}
105+
cache-from: type=gha
106+
cache-to: type=gha,mode=max
107+
provenance: false
108+
109+
- name: Verify Image Push
110+
run: |
111+
echo "Successfully pushed image:"
112+
echo "${{ env.REGISTRY }}/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}:${{ steps.timestamp.outputs.TAG }}"
113+
echo "You can find it at:"
114+
echo "https://github.com/${{ env.ORG_NAME }}/${{ env.IMAGE_NAME }}/pkgs/container/${{ env.IMAGE_NAME }}"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Sync the Newest OpenList
2+
3+
on:
4+
schedule:
5+
- cron: '0 23 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout self
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
token: ${{ secrets.WF_TOKEN }}
17+
18+
- name: Backup critical files
19+
run: |
20+
cp .github/workflows/sync_with_openlist.yaml /tmp/sync_with_openlist.yaml.bak
21+
cp .github/workflows/daily.yml /tmp/daily.yml.bak
22+
cp .github/workflows/docker.yml /tmp/docker.yml.bak
23+
cp README.md /tmp/README.md.bak
24+
cp README.zhcn.md /tmp/README.zhcn.md.bak
25+
26+
- name: Force mirror update
27+
run: |
28+
git remote add upstream https://github.com/OpenListTeam/OpenList.git || true
29+
git fetch upstream
30+
git reset --hard upstream/main
31+
git clean -fd -x
32+
33+
- name: Restore critical files
34+
run: |
35+
mkdir -p .github/workflows
36+
cp /tmp/sync_with_openlist.yaml.bak .github/workflows/sync_with_openlist.yaml
37+
cp /tmp/daily.yml.bak .github/workflows/daily.yml
38+
cp /tmp/docker.yml.bak .github/workflows/docker.yml
39+
cp /tmp/README.md.bak README.md
40+
cp /tmp/README.zhcn.md.bak README.zhcn.md
41+
42+
43+
- name: Commit and push
44+
run: |
45+
git config --global user.name "OpenList Syncer"
46+
git config --global user.email "openlistsyncer@ilovescratch.dpdns.org"
47+
48+
git add .github/workflows/daily.yml
49+
git add .github/workflows/docker.yml
50+
git add .github/workflows/sync_with_openlist.yaml
51+
git add README.md
52+
git add README.zhcn.md
53+
54+
if git diff-index --quiet HEAD --; then
55+
echo "No changes to commit"
56+
else
57+
git commit -m "Sync: sync the newest OpenList $(date +'%Y-%m-%d')"
58+
git push --force origin main
59+
fi

0 commit comments

Comments
 (0)