浏览代码

dump version to 2.6.0

兔姬桑 4 年之前
父节点
当前提交
1f764bd71b
共有 2 个文件被更改,包括 35 次插入10 次删除
  1. 34 9
      .github/workflows/build-image.yml
  2. 1 1
      config/version.php

+ 34 - 9
.github/workflows/build-image.yml

@@ -1,28 +1,53 @@
-name: Docker Build And Push To Docker Hub
+name: ProxyPanel Docker
 
 on:
   push:
     branches:
-#      - master
+    #      - master
     tags:
       - V*
 
 jobs:
   build:
-    name: Build Proxy Panel
+    name: Build ProxyPanel Docker Image
     runs-on: ubuntu-18.04
     steps:
       - name: Git Checkout Code
         uses: actions/checkout@v1
         id: git_checkout
 
-      - name: Build and push Docker images
-        uses: docker/build-push-action@v1
+      - name: Prepare
+        id: prep
+        run: |
+          DOCKER_IMAGE=${{ secrets.DOCKER_REPO }}
+          VERSION=edge
+          if [[ $GITHUB_REF == refs/tags/* ]]; then
+          VERSION=${GITHUB_REF#refs/tags/}
+          elif [[ $GITHUB_REF == refs/heads/* ]]; then
+          VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
+          elif [[ $GITHUB_REF == refs/pull/* ]]; then
+          VERSION=pr-${{ github.event.number }}
+          fi
+
+          echo ::set-output name=version::${VERSION}
+          echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
+
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v1
+
+      - name: Login to DockerHub
+        uses: docker/login-action@v1
         with:
-          push: true
           username: ${{ secrets.DOCKER_USERNAME }}
           password: ${{ secrets.DOCKER_PASSWORD }}
-          repository: ${{ secrets.DOCKER_REPO }}
-          tag_with_ref: true
-          tag_with_sha: true
+
+      - name: Build and push
+        uses: docker/build-push-action@v2
+        with:
+          context: .
+          file: ./Dockerfile
           tags: latest
+          labels: |
+            org.opencontainers.image.source=${{ github.event.repository.html_url }}
+            org.opencontainers.image.created=${{ steps.prep.outputs.created }}
+            org.opencontainers.image.revision=${{ github.sha }}

+ 1 - 1
config/version.php

@@ -2,5 +2,5 @@
 
 return [
     'name' => 'ProxyPanel',
-    'number' => '2.6.d',
+    'number' => '2.6.0',
 ];