diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 512a367..30c33b5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: bash ./publish_release/publish_ipk.sh env: version: ${{ github.event.inputs.version }} - + - name: Create release info id: create_release uses: actions/create-release@v1 @@ -47,7 +47,7 @@ jobs: asset_path: ./release/WeiboTask-windows_86-v${{ github.event.inputs.version }}.zip asset_name: WeiboTask-windows_86-v${{ github.event.inputs.version }}.zip asset_content_type: application/zip - + - name: Upload linux_64 uses: actions/upload-release-asset@v1 env: @@ -57,7 +57,7 @@ jobs: asset_path: ./release/WeiboTask-linux_64-v${{ github.event.inputs.version }}.tar asset_name: WeiboTask-linux_64-v${{ github.event.inputs.version }}.tar asset_content_type: application/x-tar - + - name: Upload linux_arm uses: actions/upload-release-asset@v1 env: @@ -67,7 +67,7 @@ jobs: asset_path: ./release/WeiboTask-linux_arm-v${{ github.event.inputs.version }}.tar asset_name: WeiboTask-linux_arm-v${{ github.event.inputs.version }}.tar asset_content_type: application/x-tar - + - name: Upload linux_arm64 uses: actions/upload-release-asset@v1 env: @@ -77,7 +77,7 @@ jobs: asset_path: ./release/WeiboTask-linux_arm64-v${{ github.event.inputs.version }}.tar asset_name: WeiboTask-linux_arm64-v${{ github.event.inputs.version }}.tar asset_content_type: application/x-tar - + - name: Upload linux_mips uses: actions/upload-release-asset@v1 env: @@ -87,7 +87,7 @@ jobs: asset_path: ./release/WeiboTask-linux_mips-v${{ github.event.inputs.version }}.tar asset_name: WeiboTask-linux_mips-v${{ github.event.inputs.version }}.tar asset_content_type: application/x-tar - + - name: Upload linux_mipsle uses: actions/upload-release-asset@v1 env: @@ -107,7 +107,7 @@ jobs: asset_path: ./ipk/WeiboTask_${{ github.event.inputs.version }}_mips.ipk asset_name: WeiboTask_${{ github.event.inputs.version }}_mips.ipk asset_content_type: application/x-gzip - + - name: Upload linux_mipsle ipk uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml new file mode 100644 index 0000000..362e5e7 --- /dev/null +++ b/.github/workflows/publish_docker.yml @@ -0,0 +1,53 @@ +name: 'publish docker' + +on: + workflow_dispatch: + inputs: + version: + description: '版本号' + required: true + +jobs: + run: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build Dockerfile + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64 + push: true + tags: | + happy888888/weibotask:${{ github.event.inputs.version }} + happy888888/weibotask:latest + + - name: Build Dockerfile-arm + uses: docker/build-push-action@v2 + with: + platforms: linux/arm/v7 + push: true + tags: | + happy888888/weibotask:arm-${{ github.event.inputs.version }} + happy888888/weibotask:arm-latest + + - name: Build Dockerfile-arm64 + uses: docker/build-push-action@v2 + with: + platforms: linux/arm64 + push: true + tags: | + happy888888/weibotask:arm64-${{ github.event.inputs.version }} + happy888888/weibotask:arm64-latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..43dcb3a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.15.6-alpine3.12 as builder +WORKDIR /go +COPY ./src ./src +RUN CGO_ENABLED=0 GOPATH=$(pwd) go install -ldflags "-s -w" WeiboTask + +FROM alpine:3.12 +LABEL maintainer="星辰" + +RUN apk update \ + && apk add tzdata \ + && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + && echo "Asia/Shanghai" > /etc/timezone + +COPY --from=builder /go/bin/WeiboTask /usr/bin/WeiboTask + +ENTRYPOINT ["/usr/bin/WeiboTask", "-L"] +CMD ["-l", "/tmp/WeiboTask.log"] \ No newline at end of file diff --git a/README.md b/README.md index b75083d..db2dbd6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ WeiboTask ### 💥主要功能 * [x] 微博超话签到 -* [ ] 每日积分获取 +* [x] 每日积分获取