Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
🐛Update github action webdav provider
Browse files Browse the repository at this point in the history
  • Loading branch information
eritpchy committed May 13, 2024
1 parent 06bbb66 commit f792ee6
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 86 deletions.
88 changes: 27 additions & 61 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Build Docker Image

# Controls when the action will run.
# Controls when the action will run.
on:
push:
branches:
Expand All @@ -29,20 +29,24 @@ env:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
buildx:
runs-on: ${{ matrix.target.os }}
strategy:
matrix:
target:
- { os: self-hosted, arch: arm64, suffix: linux }
- { os: ubuntu-22.04, arch: amd64, suffix: linux }
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
-
name: Fixup docker permission denied
run: sudo chmod 777 /var/run/docker.sock
if: matrix.target.os == 'self-hosted'
name: Get current date
id: date
run: echo "::set-output name=today::$(date +'%Y%m%d')"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
-
name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
Expand All @@ -66,57 +70,19 @@ jobs:
# Set VERSION_INFORMATION
-
run: echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q ciPrintVersionInformation)" >> $GITHUB_ENV
-
name: Build Docker Image
run: >
docker buildx build --cache-from type=gha --cache-to type=gha,mode=max
-t eritpchy/webdav-aliyundriver:${{ env.VERSION_INFORMATION }}-${{ matrix.target.arch }}
-t eritpchy/aliyundrive-webdav:${{ env.VERSION_INFORMATION }}-${{ matrix.target.arch }} .
-
name: Push Docker Image eritpchy/webdav-aliyundriver:latest(OLD)
run: docker push eritpchy/webdav-aliyundriver:${{ env.VERSION_INFORMATION }}-${{ matrix.target.arch }}
-
name: Push Docker Image eritpchy/aliyundrive-webdav:latest
run: docker push eritpchy/aliyundrive-webdav:${{ env.VERSION_INFORMATION }}-${{ matrix.target.arch }}
publish:
needs: buildx
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v3
-
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
-
run: chmod +x ${{github.workspace}}/gradlew
# Set VERSION_INFORMATION
-
run: echo "VERSION_INFORMATION=$(${{github.workspace}}/gradlew -q ciPrintVersionInformation)" >> $GITHUB_ENV
-
name: Login to Docker Hub
uses: docker/login-action@v2
name: Build and push
uses: docker/build-push-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Create Docker Manifest for eritpchy/webdav-aliyundriver:latest(OLD)
run: |
docker manifest create eritpchy/webdav-aliyundriver:latest \
--amend eritpchy/webdav-aliyundriver:${{ env.VERSION_INFORMATION }}-amd64 \
--amend eritpchy/webdav-aliyundriver:${{ env.VERSION_INFORMATION }}-arm64
-
name: Push Docker Manifest for eritpchy/webdav-aliyundriver:latest(OLD)
run: docker manifest push eritpchy/webdav-aliyundriver:latest
-
name: Create Docker Manifest for eritpchy/aliyundrive-webdav:latest
run: |
docker manifest create eritpchy/aliyundrive-webdav:latest \
--amend eritpchy/aliyundrive-webdav:${{ env.VERSION_INFORMATION }}-amd64 \
--amend eritpchy/aliyundrive-webdav:${{ env.VERSION_INFORMATION }}-arm64
-
name: Push Docker Manifest for eritpchy/aliyundrive-webdav:latest
run: docker manifest push eritpchy/aliyundrive-webdav:latest
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
eritpchy/aliyundrive-webdav:latest
eritpchy/aliyundrive-webdav:${{ env.VERSION_INFORMATION }}-${{ steps.date.outputs.today }}
eritpchy/webdav-aliyundriver:latest
eritpchy/webdav-aliyundriver:${{ env.VERSION_INFORMATION }}-${{ steps.date.outputs.today }}
18 changes: 10 additions & 8 deletions .github/workflows/build-jar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ jobs:
run: ./gradlew --no-daemon :bootJar
-
name: Upload artifacts
uses: Wandalen/wretry.action@v1.0.36
uses: Wandalen/wretry.action@master
with:
action: bxb100/action-upload-webdav@v1
action: bxb100/action-upload@main
with: |
webdav_address: ${{secrets.WEBDAV_ADDRESS}}
webdav_username: ${{secrets.WEBDAV_USERNAME}}
webdav_password: ${{secrets.WEBDAV_PASSWORD}}
webdav_upload_path: "/${{ env.VERSION_INFORMATION }}"
files: |
build/libs/aliyundrive-webdav-${{ env.VERSION_INFORMATION }}.jar
provider: webdav
provider_options: |
endpoint=${{secrets.WEBDAV_ADDRESS}}
username=${{secrets.WEBDAV_USERNAME}}
password=${{secrets.WEBDAV_PASSWORD}}
root=/${{ env.VERSION_INFORMATION }}/
include: |
build/libs/aliyundrive-webdav-*.jar
attempt_limit: 3
attempt_delay: 0
19 changes: 10 additions & 9 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
target:
- { os: macos-13, arch: x86_64, suffix: darwin }
- { os: macos-14, arch: arm64, suffix: darwin }
- { os: self-hosted, arch: arm64, suffix: linux }
- { os: ubuntu-22.04, arch: amd64, suffix: linux }
steps:
-
Expand Down Expand Up @@ -76,15 +75,17 @@ jobs:
path: "./aliyundrive-webdav-${{matrix.target.suffix}}-${{matrix.target.arch}}"
-
name: Upload artifacts
uses: Wandalen/wretry.action@v1.0.36
uses: Wandalen/wretry.action@master
with:
action: bxb100/action-upload-webdav@v1
action: bxb100/action-upload@main
with: |
webdav_address: ${{secrets.WEBDAV_ADDRESS}}
webdav_username: ${{secrets.WEBDAV_USERNAME}}
webdav_password: ${{secrets.WEBDAV_PASSWORD}}
webdav_upload_path: "/${{ env.VERSION_INFORMATION }}"
files: |
build/native/nativeCompile/aliyundrive-webdav-${{matrix.target.suffix}}-${{matrix.target.arch}}.tar.gz
provider: webdav
provider_options: |
endpoint=${{secrets.WEBDAV_ADDRESS}}
username=${{secrets.WEBDAV_USERNAME}}
password=${{secrets.WEBDAV_PASSWORD}}
root=/${{ env.VERSION_INFORMATION }}/
include: |
build/native/nativeCompile/aliyundrive-webdav-${{matrix.target.suffix}}-*.tar.gz
attempt_limit: 3
attempt_delay: 0
18 changes: 10 additions & 8 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ jobs:
path: "./aliyundrive-webdav-${{matrix.target.suffix}}-${{matrix.target.arch}}.exe"
-
name: Upload artifacts
uses: Wandalen/wretry.action@v1.0.36
uses: Wandalen/wretry.action@master
with:
action: bxb100/action-upload-webdav@v1
action: bxb100/action-upload@main
with: |
webdav_address: ${{secrets.WEBDAV_ADDRESS}}
webdav_username: ${{secrets.WEBDAV_USERNAME}}
webdav_password: ${{secrets.WEBDAV_PASSWORD}}
webdav_upload_path: "/${{ env.VERSION_INFORMATION }}"
files: |
build/native/nativeCompile/aliyundrive-webdav-${{matrix.target.suffix}}-${{matrix.target.arch}}.exe.zip
provider: webdav
provider_options: |
endpoint=${{secrets.WEBDAV_ADDRESS}}
username=${{secrets.WEBDAV_USERNAME}}
password=${{secrets.WEBDAV_PASSWORD}}
root=/${{ env.VERSION_INFORMATION }}/
include: |
build/native/nativeCompile/aliyundrive-webdav-${{matrix.target.suffix}}-*.exe.zip
attempt_limit: 3
attempt_delay: 0

0 comments on commit f792ee6

Please sign in to comment.