Skip to content

Commit

Permalink
test with common build job?
Browse files Browse the repository at this point in the history
  • Loading branch information
clbx committed Jul 25, 2024
1 parent f0fcb43 commit 42e7729
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 97 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build Job

on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
build-darwin:
runs-on: macos-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.22.0"

- name: Check out Code
uses: actions/[email protected]

- name: Build
run: go build -v -ldflags "-X main.Version=${{ inputs.version }}" -o kubectl-browse-pvc .

- name: Fix permissions
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-darwin
path: |
./kubectl-browse-pvc
LICENSE
build-linux:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.22.0"

- name: Check out Code
uses: actions/[email protected]

- name: Build
run: go build -v -ldflags "-X main.Version=${GITHUB_SHA::7}" -o kubectl-browse-pvc .

- name: Fix permissions
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-linux
path: |
./kubectl-browse-pvc
LICENSE
52 changes: 4 additions & 48 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,9 @@ on:
- main

jobs:
build-darwin:
runs-on: macos-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.22.0"

- name: Check out Code
uses: actions/[email protected]

- name: Build
run: go build -v -ldflags "-X main.Version=${GITHUB_SHA::7}" -o kubectl-browse-pvc .

- name: Fix permissions
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-darwin
path: |
./kubectl-browse-pvc
LICENSE
build-linux:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.22.0"

- name: Check out Code
uses: actions/[email protected]

- name: Build
run: go build -v -ldflags "-X main.Version=${GITHUB_SHA::7}" -o kubectl-browse-pvc .

- name: Fix permissions
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-linux
path: |
./kubectl-browse-pvc
LICENSE
call-common-jobs:
uses: ./.github/workflows/build.yaml
with:
version: ${GITHUB_SHA::7}


53 changes: 4 additions & 49 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,55 +6,10 @@ on:
tags:
- "v*.*.*"
jobs:
build-darwin:
runs-on: macos-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.22.0"

- name: Check out Code
uses: actions/[email protected]

- name: Build
run: go build -v -ldflags "-X main.Version=${{ github.ref_name }}" -o kubectl-browse-pvc .

- name: Fix permissions
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-darwin
path: |
./kubectl-browse-pvc
LICENSE
build-linux:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.22.0"

- name: Check out Code
uses: actions/[email protected]

- name: Build
run: go build -v -ldflags "-X main.Version=${{ github.ref_name }}" -o kubectl-browse-pvc .

- name: Fix permissions
run: chmod +x ./kubectl-browse-pvc

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: kubectl-browse-pvc-linux
path: |
./kubectl-browse-pvc
LICENSE
call-common-jobs:
uses: ./.github/workflows/build.yaml
with:
version: ${{ github.ref_name }}
create-release:
runs-on: ubuntu-latest
needs: [build-darwin, build-linux]
Expand Down

0 comments on commit 42e7729

Please sign in to comment.