-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/driver-github-api
- Loading branch information
Showing
25 changed files
with
384 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,16 @@ on: | |
tags: | ||
- 'v*' | ||
|
||
env: | ||
IMAGE_REGISTRY: 'xhofe/alist' | ||
REGISTRY_USERNAME: 'xhofe' | ||
REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} | ||
ARTIFACT_NAME: 'binaries_docker_release' | ||
RELEASE_PLATFORMS: 'linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64' | ||
|
||
jobs: | ||
release_docker: | ||
name: Release Docker | ||
build_binary: | ||
name: Build Binaries for Docker Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
|
@@ -31,11 +38,45 @@ jobs: | |
- name: Build go binary | ||
run: bash build.sh release docker-multiplatform | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
images: xhofe/alist | ||
name: ${{ env.ARTIFACT_NAME }} | ||
overwrite: true | ||
path: | | ||
build/ | ||
!build/*.tgz | ||
!build/musl-libs/** | ||
release_docker: | ||
needs: build_binary | ||
name: Release Docker image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: ["latest", "ffmpeg", "aria2", "aio"] | ||
include: | ||
- image: "latest" | ||
build_arg: "" | ||
tag_favor: "" | ||
- image: "ffmpeg" | ||
build_arg: INSTALL_FFMPEG=true | ||
tag_favor: "suffix=-ffmpeg,onlatest=true" | ||
- image: "aria2" | ||
build_arg: INSTALL_ARIA2=true | ||
tag_favor: "suffix=-aria2,onlatest=true" | ||
- image: "aio" | ||
build_arg: | | ||
INSTALL_FFMPEG=true | ||
INSTALL_ARIA2=true | ||
tag_favor: "suffix=-aio,onlatest=true" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }} | ||
path: 'build/' | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
@@ -46,63 +87,26 @@ jobs: | |
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: xhofe | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
username: ${{ env.REGISTRY_USERNAME }} | ||
password: ${{ env.REGISTRY_PASSWORD }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Dockerfile.ci | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64 | ||
|
||
- name: Docker meta with ffmpeg | ||
id: meta-ffmpeg | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: xhofe/alist | ||
images: ${{ env.IMAGE_REGISTRY }} | ||
flavor: | | ||
latest=true | ||
suffix=-ffmpeg,onlatest=true | ||
- name: Build and push with ffmpeg | ||
id: docker_build_ffmpeg | ||
${{ matrix.tag_favor }} | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Dockerfile.ci | ||
push: true | ||
tags: ${{ steps.meta-ffmpeg.outputs.tags }} | ||
labels: ${{ steps.meta-ffmpeg.outputs.labels }} | ||
build-args: INSTALL_FFMPEG=true | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/386,linux/arm/v6,linux/s390x,linux/ppc64le,linux/riscv64 | ||
|
||
release_docker_with_aria2: | ||
needs: release_docker | ||
name: Release docker with aria2 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: alist-org/with_aria2 | ||
ref: main | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- name: Add tag | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "IlaBot" | ||
git tag -a ${{ github.ref_name }} -m "release ${{ github.ref_name }}" | ||
- name: Push tags | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.MY_TOKEN }} | ||
branch: main | ||
repository: alist-org/with_aria2 | ||
build-args: ${{ matrix.build_arg }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ env.RELEASE_PLATFORMS }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ RUN bash build.sh release docker | |
FROM alpine:edge | ||
|
||
ARG INSTALL_FFMPEG=false | ||
ARG INSTALL_ARIA2=false | ||
LABEL MAINTAINER="[email protected]" | ||
|
||
WORKDIR /opt/alist/ | ||
|
@@ -18,13 +19,25 @@ RUN apk update && \ | |
apk upgrade --no-cache && \ | ||
apk add --no-cache bash ca-certificates su-exec tzdata; \ | ||
[ "$INSTALL_FFMPEG" = "true" ] && apk add --no-cache ffmpeg; \ | ||
[ "$INSTALL_ARIA2" = "true" ] && apk add --no-cache curl aria2 && \ | ||
mkdir -p /opt/aria2/.aria2 && \ | ||
wget https://github.com/P3TERX/aria2.conf/archive/refs/heads/master.tar.gz -O /tmp/aria-conf.tar.gz && \ | ||
tar -zxvf /tmp/aria-conf.tar.gz -C /opt/aria2/.aria2 --strip-components=1 && rm -f /tmp/aria-conf.tar.gz && \ | ||
sed -i 's|rpc-secret|#rpc-secret|g' /opt/aria2/.aria2/aria2.conf && \ | ||
sed -i 's|/root/.aria2|/opt/aria2/.aria2|g' /opt/aria2/.aria2/aria2.conf && \ | ||
sed -i 's|/root/.aria2|/opt/aria2/.aria2|g' /opt/aria2/.aria2/script.conf && \ | ||
sed -i 's|/root|/opt/aria2|g' /opt/aria2/.aria2/aria2.conf && \ | ||
sed -i 's|/root|/opt/aria2|g' /opt/aria2/.aria2/script.conf && \ | ||
touch /opt/aria2/.aria2/aria2.session && \ | ||
/opt/aria2/.aria2/tracker.sh ; \ | ||
rm -rf /var/cache/apk/* | ||
|
||
COPY --from=builder /app/bin/alist ./ | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh && /entrypoint.sh version | ||
RUN chmod +x /opt/alist/alist && \ | ||
chmod +x /entrypoint.sh && /entrypoint.sh version | ||
|
||
ENV PUID=0 PGID=0 UMASK=022 | ||
ENV PUID=0 PGID=0 UMASK=022 RUN_ARIA2=${INSTALL_ARIA2} | ||
VOLUME /opt/alist/data/ | ||
EXPOSE 5244 5245 | ||
CMD [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ FROM alpine:edge | |
|
||
ARG TARGETPLATFORM | ||
ARG INSTALL_FFMPEG=false | ||
ARG INSTALL_ARIA2=false | ||
LABEL MAINTAINER="[email protected]" | ||
|
||
WORKDIR /opt/alist/ | ||
|
@@ -10,13 +11,25 @@ RUN apk update && \ | |
apk upgrade --no-cache && \ | ||
apk add --no-cache bash ca-certificates su-exec tzdata; \ | ||
[ "$INSTALL_FFMPEG" = "true" ] && apk add --no-cache ffmpeg; \ | ||
[ "$INSTALL_ARIA2" = "true" ] && apk add --no-cache curl aria2 && \ | ||
mkdir -p /opt/aria2/.aria2 && \ | ||
wget https://github.com/P3TERX/aria2.conf/archive/refs/heads/master.tar.gz -O /tmp/aria-conf.tar.gz && \ | ||
tar -zxvf /tmp/aria-conf.tar.gz -C /opt/aria2/.aria2 --strip-components=1 && rm -f /tmp/aria-conf.tar.gz && \ | ||
sed -i 's|rpc-secret|#rpc-secret|g' /opt/aria2/.aria2/aria2.conf && \ | ||
sed -i 's|/root/.aria2|/opt/aria2/.aria2|g' /opt/aria2/.aria2/aria2.conf && \ | ||
sed -i 's|/root/.aria2|/opt/aria2/.aria2|g' /opt/aria2/.aria2/script.conf && \ | ||
sed -i 's|/root|/opt/aria2|g' /opt/aria2/.aria2/aria2.conf && \ | ||
sed -i 's|/root|/opt/aria2|g' /opt/aria2/.aria2/script.conf && \ | ||
touch /opt/aria2/.aria2/aria2.session && \ | ||
/opt/aria2/.aria2/tracker.sh ; \ | ||
rm -rf /var/cache/apk/* | ||
|
||
COPY /build/${TARGETPLATFORM}/alist ./ | ||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh && /entrypoint.sh version | ||
RUN chmod +x /opt/alist/alist && \ | ||
chmod +x /entrypoint.sh && /entrypoint.sh version | ||
|
||
ENV PUID=0 PGID=0 UMASK=022 | ||
ENV PUID=0 PGID=0 UMASK=022 RUN_ARIA2=${INSTALL_ARIA2} | ||
VOLUME /opt/alist/data/ | ||
EXPOSE 5244 5245 | ||
CMD [ "/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
#!/bin/bash | ||
|
||
chown -R ${PUID}:${PGID} /opt/alist/ | ||
|
||
umask ${UMASK} | ||
|
||
if [ "$1" = "version" ]; then | ||
./alist version | ||
else | ||
if [ "$RUN_ARIA2" = "true" ]; then | ||
chown -R ${PUID}:${PGID} /opt/aria2/ | ||
exec su-exec ${PUID}:${PGID} nohup aria2c \ | ||
--enable-rpc \ | ||
--rpc-allow-origin-all \ | ||
--conf-path=/opt/aria2/.aria2/aria2.conf \ | ||
>/dev/null 2>&1 & | ||
fi | ||
|
||
chown -R ${PUID}:${PGID} /opt/alist/ | ||
exec su-exec ${PUID}:${PGID} ./alist server --no-prefix | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.