Skip to content

Commit

Permalink
Update release github action
Browse files Browse the repository at this point in the history
  • Loading branch information
alperencelik committed Jan 6, 2024
1 parent 5619521 commit 8fc6367
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
name: docker-build
name: Release

on:
push:
branches:
- "main"

env:
TEST_TAG: alperencelik/kubemox:test
LATEST_TAG: alperencelik/kubemox:latest
tags:
- '*'

jobs:
docker:
verify:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
go-version: 1.21

- name: Check out code
uses: actions/checkout@v2

- name: Run mage.go
run: go run mage.go

release:
needs: verify
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.LATEST_TAG }}
go-version: 1.21

- name: Check out code
uses: actions/checkout@v2

- name: Run mage.go Release
run: go run mage.go Release
14 changes: 7 additions & 7 deletions magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ func All() error {

// Test runs various test functions
func Test() error {
if err := mage.TestGo(true); err != nil {
return err
}
// if err := mage.TestGo(true); err != nil {
// return err
// }

return nil
}
Expand All @@ -72,10 +72,10 @@ func Verify() error {
return err
}

// log.Println("Running golangci-lint...")
// if err := mage.RunGolangCILint("", false); err != nil {
// return err
// }
// log.Println("Running golangci-lint...")
// if err := mage.RunGolangCILint("", false); err != nil {
// return err
// }

log.Println("Running go build...")
if err := mage.VerifyBuild(scriptDir); err != nil {
Expand Down

0 comments on commit 8fc6367

Please sign in to comment.