添加功能
This commit is contained in:
parent
c2a2acda4c
commit
6fd541faf3
|
@ -31,19 +31,52 @@ jobs:
|
||||||
uses: https://github.com/actions/setup-go@v4
|
uses: https://github.com/actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '1.20'
|
go-version: '1.20'
|
||||||
|
- name: Set up QEMU
|
||||||
|
id: qemu
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
- name: Check snapshot
|
||||||
|
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||||
|
id: snapshot
|
||||||
|
run: echo '::set-output name=ARG::--snapshot'
|
||||||
- name: Fetch all tags
|
- name: Fetch all tags
|
||||||
run: git fetch --force --tags
|
run: git fetch --force --tags
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
uses: https://github.com/goreleaser/goreleaser-action@v4
|
uses: https://github.com/goreleaser/goreleaser-action@v4
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: build --snapshot
|
args: build --rm-dist ${{ steps.snapshot.outputs.ARG }} --timeout 2h30m
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
GITEA_TOKEN: ${{ secrets.TOKEN }}
|
||||||
# - name: upload-artifact
|
-
|
||||||
# uses: actions/upload-artifact@v3
|
name: Docker meta
|
||||||
# with:
|
id: meta
|
||||||
# name: my-artifact
|
uses: docker/metadata-action@v4
|
||||||
# path: dist/*/*
|
with:
|
||||||
|
images: huoxue1/qinglong-go
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest
|
||||||
|
type=ref,event=tag
|
||||||
|
-
|
||||||
|
name: Docker Login
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
ulimit: core=0:0
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue