Skip to content

Commit

Permalink
Merge pull request #9 from Avi-Robusta/working_version
Browse files Browse the repository at this point in the history
Working version
  • Loading branch information
Avi-Robusta authored Jul 2, 2024
2 parents b301604 + 773e372 commit 5b01531
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 80 deletions.
45 changes: 3 additions & 42 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,49 +16,10 @@ on:
permissions:
contents: read
env:
GO_VERSION: "1.17"
GO_VERSION: "1.22.4"
jobs:
lint:
name: Run linter
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run linter
run: make lint
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make test
release-snapshot:
name: Release unversioned snapshot
needs:
- lint
- test
runs-on: ubuntu-latest
steps:
- name: Setup Go
Expand All @@ -73,5 +34,5 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Release
run: make release-snapshot
- name: Build binary
run: CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage ./cmd/kube-lineage
65 changes: 27 additions & 38 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,10 @@ name: release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*'
env:
GO_VERSION: "1.17"
GO_VERSION: "1.22.4"
jobs:
lint:
name: Run linter
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run linter
run: make lint
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make test
release:
name: Release
runs-on: ubuntu-latest
Expand All @@ -63,3 +27,28 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build binary
run: CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o kube-lineage ./cmd/kube-lineage
- name: Upload binary to release
uses: actions/upload-artifact@v3
with:
name: kube-lineage
path: kube-lineage
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./kube-lineage
asset_name: kube-lineage
asset_content_type: application/octet-stream

0 comments on commit 5b01531

Please sign in to comment.