2020-06-01 18:27:26 +08:00
|
|
|
name: Docker release build
|
|
|
|
|
2020-05-28 15:22:17 +08:00
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-04-27 00:52:03 +08:00
|
|
|
if: github.repository == 'rclone/rclone'
|
2020-05-28 15:22:17 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Build image job
|
|
|
|
steps:
|
2023-10-18 22:29:55 +08:00
|
|
|
- name: Free some space
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
df -h .
|
|
|
|
# Remove android SDK
|
|
|
|
sudo rm -rf /usr/local/lib/android || true
|
|
|
|
# Remove .net runtime
|
|
|
|
sudo rm -rf /usr/share/dotnet || true
|
|
|
|
df -h .
|
2020-05-28 15:22:17 +08:00
|
|
|
- name: Checkout master
|
2023-09-05 06:14:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-06-01 18:27:26 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-05-28 15:22:17 +08:00
|
|
|
- name: Get actual patch version
|
|
|
|
id: actual_patch_version
|
|
|
|
run: echo ::set-output name=ACTUAL_PATCH_VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/v//g')
|
|
|
|
- name: Get actual minor version
|
|
|
|
id: actual_minor_version
|
|
|
|
run: echo ::set-output name=ACTUAL_MINOR_VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/v//g' | cut -d "." -f 1,2)
|
|
|
|
- name: Get actual major version
|
|
|
|
id: actual_major_version
|
|
|
|
run: echo ::set-output name=ACTUAL_MAJOR_VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | sed 's/v//g' | cut -d "." -f 1)
|
2024-09-13 00:57:53 +08:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
2020-05-28 15:22:17 +08:00
|
|
|
- name: Build and publish image
|
2024-09-13 00:57:53 +08:00
|
|
|
uses: docker/build-push-action@v6
|
2020-05-28 15:22:17 +08:00
|
|
|
with:
|
2024-09-13 00:57:53 +08:00
|
|
|
file: Dockerfile
|
|
|
|
context: .
|
|
|
|
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6
|
|
|
|
push: true
|
|
|
|
tags: |
|
|
|
|
rclone/rclone:latest
|
|
|
|
rclone/rclone:${{ steps.actual_patch_version.outputs.ACTUAL_PATCH_VERSION }}
|
|
|
|
rclone/rclone:${{ steps.actual_minor_version.outputs.ACTUAL_MINOR_VERSION }}
|
|
|
|
rclone/rclone:${{ steps.actual_major_version.outputs.ACTUAL_MAJOR_VERSION }}
|
2021-05-26 17:43:50 +08:00
|
|
|
|
|
|
|
build_docker_volume_plugin:
|
|
|
|
if: github.repository == 'rclone/rclone'
|
|
|
|
needs: build
|
|
|
|
runs-on: ubuntu-latest
|
2021-07-16 06:35:54 +08:00
|
|
|
name: Build docker plugin job
|
2021-05-26 17:43:50 +08:00
|
|
|
steps:
|
2023-10-18 22:29:55 +08:00
|
|
|
- name: Free some space
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
df -h .
|
|
|
|
# Remove android SDK
|
|
|
|
sudo rm -rf /usr/local/lib/android || true
|
|
|
|
# Remove .net runtime
|
|
|
|
sudo rm -rf /usr/share/dotnet || true
|
|
|
|
df -h .
|
2021-05-26 17:43:50 +08:00
|
|
|
- name: Checkout master
|
2023-09-05 06:14:49 +08:00
|
|
|
uses: actions/checkout@v4
|
2021-05-26 17:43:50 +08:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-07-16 06:35:54 +08:00
|
|
|
- name: Build and publish docker plugin
|
2021-05-26 17:43:50 +08:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-07-16 06:35:54 +08:00
|
|
|
VER=${GITHUB_REF#refs/tags/}
|
|
|
|
PLUGIN_USER=rclone
|
|
|
|
docker login --username ${{ secrets.DOCKER_HUB_USER }} \
|
|
|
|
--password-stdin <<< "${{ secrets.DOCKER_HUB_PASSWORD }}"
|
2022-05-24 01:04:03 +08:00
|
|
|
for PLUGIN_ARCH in amd64 arm64 arm/v7 arm/v6 ;do
|
2021-07-16 06:35:54 +08:00
|
|
|
export PLUGIN_USER PLUGIN_ARCH
|
|
|
|
make docker-plugin PLUGIN_TAG=${PLUGIN_ARCH/\//-}
|
|
|
|
make docker-plugin PLUGIN_TAG=${PLUGIN_ARCH/\//-}-${VER#v}
|
|
|
|
done
|
|
|
|
make docker-plugin PLUGIN_ARCH=amd64 PLUGIN_TAG=latest
|
|
|
|
make docker-plugin PLUGIN_ARCH=amd64 PLUGIN_TAG=${VER#v}
|