chore: upgrade dependencies #43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests and Build | |
on: | |
push: | |
branches: [ "*" ] | |
tags: [ "v*" ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# fetching all tags is required for the Makefile to compute the right version | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.22" | |
- name: Set up QEMU dependency | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Share cache with other actions | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/go/pkg/mod | |
/tmp/.buildx-cache | |
key: ${{ runner.os }}-tests-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-tests- | |
- name: Run tests | |
run: make tests | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# fetching all tags is required for the Makefile to compute the right version | |
fetch-depth: 0 | |
- name: Remote helm tags | |
run: | | |
git tag --list |grep "helm/"|xargs git tag --delete | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.22" | |
- name: Set up QEMU dependency | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Share cache with other actions | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
ui/node_modules | |
/tmp/.buildx-cache | |
key: ${{ runner.os }}-build-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-build- | |
- name: Ensure all files were well formatted | |
run: make check-fmt | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY }} | |
passphrase: ${{ secrets.GPG_PASSWORD }} | |
- name: Build Snapshot | |
env: | |
CI: false | |
run: make build-snapshot | |
- name: Release Snapshot | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | |
env: | |
CI: false | |
GITHUB_TOKEN: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
run: make release-snapshot | |
build-image: | |
name: Build Docker Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# fetching all tags is required for the Makefile to compute the right version | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.22" | |
- name: Set up QEMU dependency | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Share cache with other actions | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
/tmp/.buildx-cache | |
key: ${{ runner.os }}-build-image-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-build-image- | |
- name: Build Docker images | |
run: make docker-build | |
- name: Scan Docker images | |
run: make docker-scan | |
- name: Push Docker images | |
if: github.ref == 'refs/heads/main' | |
run: make docker-push | |
release: | |
name: Release Binaries | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
needs: | |
- tests | |
- build | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# fetching all tags is required for the Makefile to compute the right version | |
fetch-depth: 0 | |
- name: Remote helm tags | |
run: | | |
git tag --list |grep "helm/"|xargs git tag --delete | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.22" | |
- name: Share cache with other actions | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
ui/node_modules | |
/tmp/.buildx-cache | |
key: ${{ runner.os }}-build-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-build- | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v4 | |
with: | |
gpg_private_key: ${{ secrets.GPG_KEY }} | |
passphrase: ${{ secrets.GPG_PASSWORD }} | |
- name: Build binaries | |
env: | |
CI: false | |
run: make build | |
- name: Release binaries | |
env: | |
CI: false | |
UPLOAD_LKAR_USERNAME: ${{ secrets.REPOSITORIES_ACCESS_USER }} | |
UPLOAD_LKAR_SECRET: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
run: make release | |
release-image: | |
name: Release Docker Image | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
needs: | |
- tests | |
- build-image | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
# fetching all tags is required for the Makefile to compute the right version | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.22" | |
- name: Set up QEMU dependency | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Share cache with other actions | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
/tmp/.buildx-cache | |
key: ${{ runner.os }}-build-image-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-build-image- | |
- name: Build Docker images | |
run: make docker-build | |
- name: Release Docker images | |
run: make docker-push |