mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 01:15:41 +08:00
ci: fix build error (#314)
This commit is contained in:
parent
1b972af52c
commit
d68f361c35
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@ -5,6 +5,7 @@ on:
|
||||
- 'dev'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
APP_NAME: glider
|
||||
@ -18,7 +19,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@ -28,11 +29,10 @@ jobs:
|
||||
echo "GO_MOD_VERSION=$(grep -P "go \d+\." go.mod | cut -d " " -f2)" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
stable: false
|
||||
check-latest: true
|
||||
go-version: '1.18.0-rc1'
|
||||
go-version: '1.18.0-rc.1'
|
||||
# go-version: ${{ env.GO_MOD_VERSION}}
|
||||
|
||||
- name: Set up Cache
|
||||
@ -58,7 +58,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Upload Artifact - Linux amd64
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||
with:
|
||||
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-linux-amd64
|
||||
@ -66,7 +66,7 @@ jobs:
|
||||
./dist/default_linux_amd64/${{ env.APP_NAME }}
|
||||
|
||||
- name: Upload Artifact - Linux arm64
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||
with:
|
||||
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-linux-arm64
|
||||
@ -74,7 +74,7 @@ jobs:
|
||||
./dist/default_linux_arm64/${{ env.APP_NAME }}
|
||||
|
||||
- name: Upload Artifact - macOS arm64
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||
with:
|
||||
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-macos-arm64
|
||||
@ -82,7 +82,7 @@ jobs:
|
||||
./dist/default_darwin_arm64/${{ env.APP_NAME }}
|
||||
|
||||
- name: Upload Artifact - Windows amd64
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
if: "!startsWith(github.ref, 'refs/tags/')"
|
||||
with:
|
||||
name: ${{ env.APP_NAME }}-dev-${{ env.SHA_SHORT }}-windows-amd64
|
||||
@ -98,19 +98,20 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Docker - Set up Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Docker - Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Docker - Login to GHCR
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
@ -128,12 +129,13 @@ jobs:
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
|
||||
- name: Docker - Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: .Dockerfile
|
||||
platforms: ${{ env.PLATFORMS }}
|
||||
push: true
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
Loading…
Reference in New Issue
Block a user