This repository has been archived by the owner on Jun 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: updated dependencies * ci: updated go version
- Loading branch information
1 parent
456fbf1
commit a8b545f
Showing
8 changed files
with
214 additions
and
219 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -28,7 +26,7 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: get-tags | ||
- name: get-tags | ||
run: git fetch --force --tags | ||
|
||
- name: Get svu | ||
|
@@ -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 | ||
|
@@ -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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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] | ||
|
@@ -81,7 +79,7 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: get-tags | ||
- name: get-tags | ||
run: git fetch --force --tags | ||
|
||
- name: Get svu | ||
|
@@ -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: | ||
|
@@ -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 |
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
Oops, something went wrong.