Skip to content

Commit

Permalink
feat: adds poc sigstore-cert-maker.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhundere committed Nov 9, 2024
1 parent 138f860 commit 58478e0
Show file tree
Hide file tree
Showing 21 changed files with 474 additions and 514 deletions.
3 changes: 0 additions & 3 deletions .codecov.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/labeler.yml

This file was deleted.

124 changes: 10 additions & 114 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,137 +4,33 @@ name: Build and Test
on:
pull_request:
branches: [main]
paths:
- '**/Dockerfile'
- '**/.dockerignore'
- .github/**
- '**.go'
- '**.mod'
- '**.sum'
- config/**
- '**/Makefile*'
- '**/documentation.md'
- .golangci.yaml
- .goreleaser.yaml

push:
branches: [main]

jobs:
lint:
strategy:
matrix:
go: ['1.22']
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false

- name: Make install-tools
run: make install-tools

- name: Make lint
run: make lint

- name: Check Code Generation
run: |
make generate
git diff -s --exit-code || (echo 'Generated code is out of date. Run make generate and commit the changes' && exit 1)
- name: Check packages are up-to-date
run: |
make tidy
git diff -s --exit-code || (echo 'Packages are out of date. Run make tidy and commit the changes' && exit 1)
build:
name: build
strategy:
matrix:
GOOS: [darwin, linux, windows]
GOARCH: [arm64, amd64, '386']
go: ['1.22']
exclude:
- GOOS: darwin
GOARCH: '386'
- GOOS: darwin
GOARCH: arm
- GOOS: windows
GOARCH: arm
- GOOS: windows
GOARCH: arm64
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false

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

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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
if: steps.cache.outputs.cache-hit != 'true'
go-version: '1.22'
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v4
with:
distribution: goreleaser-pro
version: latest
args: release --clean --snapshot --split
env:
GGOOS: ${{ matrix.GOOS }}
GGOARCH: ${{ matrix.GOARCH }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
args: --timeout=5m
- name: Run linter
run: golangci-lint run

test:
strategy:
matrix:
go: ['1.22']
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false

- name: Make test
go-version: '1.22'
- name: Run tests
run: make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4

go-semantic-release:
if: ${{ github.ref == 'refs/heads/main' }}
needs: [lint, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Run go-semantic-release
uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.SEMANTIC_RELEASE_GH_PAT }}
changelog-generator-opt: emojis=true
allow-initial-development-versions: true
17 changes: 0 additions & 17 deletions .github/workflows/pr_conventional.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/pr_labeler.yml

This file was deleted.

43 changes: 9 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,15 @@ jobs:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Go
uses: actions/setup-go@v5
with:
# go version must be quoted on version 1.22+ or else setup action
# will pull down version 1.2 instead of 1.22
go-version: '1.22'

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

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

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
- name: Build and release
run: |
go build -o sigstore-certificate-maker
tar czf sigstore-certificate-maker.tar.gz sigstore-certificate-maker
- name: Create Release
uses: softprops/action-gh-release@v1
with:
distribution: goreleaser-pro
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
files: sigstore-certificate-maker.tar.gz
73 changes: 0 additions & 73 deletions .github/workflows/scorecard.yml

This file was deleted.

28 changes: 4 additions & 24 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1,27 @@
---
run:
timeout: 10m
allow-parallel-runners: true
go: '1.22'
timeout: 5m
go: "1.22"

linters-settings:
errcheck:
check-type-assertions: false
check-blank: true

maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true

unused:
go: '1.22'

lll:
# max line length, lines longer will be reported. Default is 120.
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
line-length: 185
# tab width in spaces. Default to 1.
tab-width: 8
line-length: 120
tab-width: 4

linters:
disable-all: true
enable:
- gofmt
- errcheck
- goimports
- misspell
- noctx
- lll
- govet
- ineffassign
- typecheck
- unused
- gosimple
- staticcheck
- gosec

issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
13 changes: 0 additions & 13 deletions .vscode/launch.json

This file was deleted.

Loading

0 comments on commit 58478e0

Please sign in to comment.