Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
fix: updated dependencies (#24)
Browse files Browse the repository at this point in the history
* fix: updated dependencies

* ci: updated go version
  • Loading branch information
karl-cardenas-coding authored Mar 22, 2024
1 parent 456fbf1 commit a8b545f
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 219 deletions.
111 changes: 53 additions & 58 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ name: Release

on:
push:
branches: [ main ]
branches: [main]


permissions:
permissions:
contents: write
packages: write


env:
GITHUB_TOKEN: ${{ github.token }}
SVU_VERSION: 1.11.0
Expand All @@ -28,7 +26,7 @@ jobs:
with:
fetch-depth: 0

- name: get-tags
- name: get-tags
run: git fetch --force --tags

- name: Get svu
Expand Down Expand Up @@ -74,18 +72,17 @@ jobs:
GORELEASER_PREVIOUS_TAG: ${{ needs.tag.outputs.PREV_VERSION }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: git fetch --force --tags

- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: "1.22"
check-latest: true


- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
Expand All @@ -94,56 +91,54 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


Docker:
needs: [tag,goreleaser]
needs: [tag, goreleaser]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2


- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/[email protected]
id: build-and-push
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
build-args: |
VERSION=${{ needs.tag.outputs.VERSION }}
- uses: sigstore/[email protected]

- name: Image Signing
run: |
cosign sign --yes \
-a "repo=${{ github.repository }}" \
-a "workflow=${{ github.workflow }}" \
-a "ref=${{ github.sha }}" \
-a "owner=Spectro Cloud" \
--key env://COSIGN_PRIVATE_KEY --recursive "${TAGS}@${DIGEST}"
env:
TAGS: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/[email protected]
id: build-and-push
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
build-args: |
VERSION=${{ needs.tag.outputs.VERSION }}
- uses: sigstore/[email protected]

- name: Image Signing
run: |
cosign sign --yes \
-a "repo=${{ github.repository }}" \
-a "workflow=${{ github.workflow }}" \
-a "ref=${{ github.sha }}" \
-a "owner=Spectro Cloud" \
--key env://COSIGN_PRIVATE_KEY --recursive "${TAGS}@${DIGEST}"
env:
TAGS: ghcr.io/${{ github.repository }}:${{ needs.tag.outputs.VERSION }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
165 changes: 80 additions & 85 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ name: Test & Validate

on:
pull_request:
types: ['synchronize', 'opened']
types: ["synchronize", "opened"]
branches:
- main
- main

env:
GITHUB_TOKEN: ${{ github.token }}
MENDABLE_API_KEY: ${{secrets.MENDABLE_API_KEY}}
SLACK_SIGNING_SECRET: ${{secrets.SLACK_SIGNING_SECRET}}
SVU_VERSION: 1.11.0


concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -25,47 +24,46 @@ jobs:
shell: bash
if: ${{ !github.event.pull_request.draft }}
steps:
# If the condition above is not met, aka, the PR is not in draft status, then this step is skipped.
# Because this step is part of the critical path, omission of this step will result in remaining CI steps not gettinge executed.
# As of 8/8/2022 there is now way to enforce this beahvior in GitHub Actions CI.
# If the condition above is not met, aka, the PR is not in draft status, then this step is skipped.
# Because this step is part of the critical path, omission of this step will result in remaining CI steps not gettinge executed.
# As of 8/8/2022 there is now way to enforce this beahvior in GitHub Actions CI.
- run: exit 0

linting:
needs: [run-ci]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true
- uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true

- name: Lint Internal Package
uses: golangci/golangci-lint-action@v3
with:
args: --verbose --timeout 5m
- name: Lint Internal Package
uses: golangci/golangci-lint-action@v3
with:
args: --verbose --timeout 5m

test:
name: Test
needs: [run-ci,linting]
needs: [run-ci, linting]
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true
id: go

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Go Tests
run: |
go test -race ./...
- name: Go Tests
run: |
go test -race ./...
release-preview:
needs: [run-ci]
Expand All @@ -81,7 +79,7 @@ jobs:
with:
fetch-depth: 0

- name: get-tags
- name: get-tags
run: git fetch --force --tags

- name: Get svu
Expand Down Expand Up @@ -126,16 +124,16 @@ jobs:
GORELEASER_PREVIOUS_TAG: ${{ needs.tag.outputs.PREV_VERSION }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: git fetch --force --tags

- uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true
go-version: "1.22"
check-latest: true

- uses: goreleaser/goreleaser-action@v5
with:
Expand All @@ -145,64 +143,61 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


compile:
name: Compile validation
needs: [run-ci,linting]
needs: [run-ci, linting]
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: -v

- name: build
run: |
go build -race -ldflags="-X 'spectrocloud.com/spectromate/cmd.VersionString=1.0.0'" -o=spectromate -v
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: -v

- name: build
run: |
go build -race -ldflags="-X 'spectrocloud.com/spectromate/cmd.VersionString=1.0.0'" -o=spectromate -v
Docker:
needs: [run-ci,linting,test,compile]
needs: [run-ci, linting, test, compile]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: '1.21'
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2


- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:dev
build-args: |
VERSION=1.0.0
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: "1.22"
check-latest: true

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:dev
build-args: |
VERSION=1.0.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Spectro Cloud
# SPDX-License-Identifier: Apache-2.0

FROM golang:1.21.5-alpine3.18 as builder
FROM golang:1.22.1-alpine3.19 as builder

ARG VERSION

Expand Down
Loading

0 comments on commit a8b545f

Please sign in to comment.