diff --git a/.github/workflows/buildapp-dev.yml b/.github/workflows/buildapp-dev.yml index afba75c..f80ae2b 100644 --- a/.github/workflows/buildapp-dev.yml +++ b/.github/workflows/buildapp-dev.yml @@ -78,3 +78,5 @@ jobs: platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 push: true tags: thun888/mirouter-ui:dev + build-args: | + VERSION=${{ github.sha }} diff --git a/.github/workflows/buildapp.yml b/.github/workflows/buildapp.yml index d04c5e6..ce1577b 100644 --- a/.github/workflows/buildapp.yml +++ b/.github/workflows/buildapp.yml @@ -131,7 +131,7 @@ jobs: curl \ -H "Authorization: token ${{ secrets.TOKEN }}" \ -H "Content-Type: $(file -b --mime-type $file)" \ - --data-binary @"$file" \ + -F "file=@$file" \ "${{ steps.create_release.outputs.upload_url }}=$(basename $file)" fi done @@ -157,26 +157,23 @@ jobs: builddocker: runs-on: ubuntu-20.04 steps: - - - name: Checkout + - name: Checkout uses: actions/checkout@v3 - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - - name: Login to Docker Hub + - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build and push + - name: Build and push uses: docker/build-push-action@v4 with: context: . platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6 push: true tags: thun888/mirouter-ui:latest + build-args: | + VERSION=${{ github.event.inputs.version }} diff --git a/Dockerfile b/Dockerfile index 93585f2..fd2ad7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.0-alpine3.18 AS builder +ARG VERSION WORKDIR /app @@ -6,7 +6,7 @@ COPY . . RUN go mod download -RUN go build -ldflags "-X 'main.Version=Docker'" -o main . +RUN go build -ldflags "-X 'main.Version=$VERSION'" -o main . FROM alpine:3.18