Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 40 additions & 42 deletions .github/workflows/_shared-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: Reusable build workflow
on:
workflow_call:
inputs:
ref:
description: 'The branch, tag or SHA to build'
required: true
type: string
release:
description: 'Release version tag for this build'
default: ''
Expand All @@ -15,7 +11,7 @@ on:
docker:
description: 'Build docker images'
default: false
required: true
required: false
type: boolean
docker_repository:
description: 'Docker Hub Repository'
Expand All @@ -40,15 +36,18 @@ on:
description: 'Docker Hub Token'
required: false

permissions:
contents: read

# shared build jobs
jobs:
build_ui_package:
name: Build UI package
runs-on: ubuntu-latest
outputs:
artifact_id: ${{ steps.upload_ui.outputs.artifact-id }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}

# setup node & npm
- name: Set up node
Expand All @@ -64,14 +63,15 @@ jobs:
restore-keys: |
uipackage-npm-${{ runner.os }}-
uipackage-npm-

# build UI package
- name: Build UI package
run: |
make build-ui

# upload artifacts
- name: "Upload artifact: ui-package"
id: upload_ui
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ./ui-package/dist/*
Expand All @@ -81,17 +81,17 @@ jobs:
name: Build linux/amd64 binary
needs: [build_ui_package]
runs-on: ubuntu-latest
outputs:
artifact_id: ${{ steps.upload_binary.outputs.artifact-id }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}

# setup global dependencies
- name: Set up go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.25.x

# setup project dependencies
- name: Get dependencies
run: |
Expand All @@ -101,7 +101,8 @@ jobs:
- name: Download UI build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ui-package
artifact-ids: ${{ needs.build_ui_package.outputs.artifact_id }}
merge-multiple: true
path: ./ui-package/dist

# build binaries
Expand All @@ -113,19 +114,20 @@ jobs:

# upload artifacts
- name: "Upload artifact: explorer_linux_amd64"
id: upload_binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ./bin/*
name: explorer_linux_amd64

build_linux_arm64_binary:
name: Build linux/arm64 binary
needs: [build_ui_package]
runs-on: ubuntu-24.04-arm
outputs:
artifact_id: ${{ steps.upload_binary.outputs.artifact-id }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}

# setup global dependencies
- name: Set up go
Expand All @@ -142,7 +144,8 @@ jobs:
- name: Download UI build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ui-package
artifact-ids: ${{ needs.build_ui_package.outputs.artifact_id }}
merge-multiple: true
path: ./ui-package/dist

# build binaries
Expand All @@ -154,6 +157,7 @@ jobs:

# upload artifacts
- name: "Upload artifact: explorer_linux_arm64"
id: upload_binary
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
path: ./bin/*
Expand All @@ -165,8 +169,6 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}

# setup global dependencies
- name: Set up go
Expand All @@ -183,7 +185,8 @@ jobs:
- name: Download UI build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ui-package
artifact-ids: ${{ needs.build_ui_package.outputs.artifact_id }}
merge-multiple: true
path: ./ui-package/dist

# build binaries
Expand All @@ -206,8 +209,6 @@ jobs:
runs-on: macos-26
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}

# setup global dependencies
- name: Set up go
Expand All @@ -224,7 +225,8 @@ jobs:
- name: Download UI build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ui-package
artifact-ids: ${{ needs.build_ui_package.outputs.artifact_id }}
merge-multiple: true
path: ./ui-package/dist

# build binaries
Expand All @@ -243,13 +245,11 @@ jobs:

build_amd64_docker_image:
name: Build amd64 docker image
needs: [build_linux_amd64_binary]
needs: [build_ui_package, build_linux_amd64_binary]
if: ${{ inputs.docker }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}

- name: Get build version
id: vars
Expand All @@ -268,20 +268,22 @@ jobs:
- name: Download UI build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ui-package
artifact-ids: ${{ needs.build_ui_package.outputs.artifact_id }}
merge-multiple: true
path: ./ui-package/dist
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: explorer_linux_amd64
artifact-ids: ${{ needs.build_linux_amd64_binary.outputs.artifact_id }}
merge-multiple: true
path: ./bin

# prepare environment
- name: Prepare build environment
run: |
chmod +x ./bin/*
ls -lach ./bin

# build amd64 image
- name: Build amd64 docker image
run: |
Expand All @@ -293,16 +295,14 @@ jobs:
run: |
docker push ${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-amd64
docker push ${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-${{ steps.vars.outputs.sha_short }}-amd64

build_arm64_docker_image:
name: Build arm64 docker image
needs: [build_linux_arm64_binary]
needs: [build_ui_package, build_linux_arm64_binary]
if: ${{ inputs.docker }}
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}
- name: Get build version
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -320,20 +320,22 @@ jobs:
- name: Download UI build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ui-package
artifact-ids: ${{ needs.build_ui_package.outputs.artifact_id }}
merge-multiple: true
path: ./ui-package/dist
- name: Download build artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: explorer_linux_arm64
artifact-ids: ${{ needs.build_linux_arm64_binary.outputs.artifact_id }}
merge-multiple: true
path: ./bin

# prepare environment
- name: Prepare build environment
run: |
chmod +x ./bin/*
ls -lach ./bin

# build arm64 image
- name: Build arm64 docker image
run: |
Expand All @@ -353,8 +355,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}
- name: Get build version
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -367,7 +367,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# build multiarch image
- name: Build multiarch docker manifest
run: |
Expand All @@ -385,8 +385,6 @@ jobs:
tag: ${{ fromJSON(inputs.additional_tags) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}
- name: Get build version
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
Expand All @@ -399,7 +397,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# build multiarch image
- name: "Build additional docker manifest: ${{ matrix.tag }}"
run: |
Expand All @@ -411,4 +409,4 @@ jobs:

docker buildx imagetools create -t ${{ inputs.docker_repository }}:${{ matrix.tag }} \
${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-${{ steps.vars.outputs.sha_short }}-amd64 \
${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-${{ steps.vars.outputs.sha_short }}-arm64
${{ inputs.docker_repository }}:${{ inputs.docker_tag_prefix }}-${{ steps.vars.outputs.sha_short }}-arm64
3 changes: 3 additions & 0 deletions .github/workflows/_shared-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Reusable check workflow
on:
workflow_call:

permissions:
contents: read

# shared check jobs
jobs:
check_source:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/_shared-docker-clone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ on:
description: 'Docker Hub Token'
required: false

permissions:
contents: read

# shared build jobs
jobs:
clone_docker_images:
Expand Down
Loading