mirror of
https://github.com/JoeanAmier/XHS-Downloader.git
synced 2025-12-26 12:56:22 +08:00
- 重命名工作流:手动构建可执行文件 -> 构建可执行文件 - 添加日期变量到可执行文件名称,提高版本区分度 - 更新工作流触发条件和权限设置 - 修改 README 中关于构建和发布的说明,增加 Actions 下载链接 - 更新英文 README 中的相关信息
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: 构建并发布 Docker 镜像
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish-docker:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: 拉取源码
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: 获取最新的发布标签
|
|
id: get-latest-release
|
|
run: |
|
|
LATEST_TAG=$(curl -s \
|
|
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
|
|
https://api.github.com/repos/${{ github.repository }}/releases/latest \
|
|
| jq -r '.tag_name')
|
|
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
|
|
|
|
- name: 设置 QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: 设置 Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: 登录到 DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: 构建和推送 Docker 镜像到 Docker Hub
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKERHUB_USERNAME }}/xhs-downloader:${{ env.LATEST_TAG }}
|
|
${{ secrets.DOCKERHUB_USERNAME }}/xhs-downloader:latest
|