Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Lewis <[email protected]>
  • Loading branch information
Ian Lewis committed May 15, 2023
0 parents commit 138eafa
Show file tree
Hide file tree
Showing 26 changed files with 2,539 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/go-ossf-slsa3-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow lets you compile your Go project using a SLSA3 compliant builder.
# This workflow will generate a so-called "provenance" file describing the steps
# that were performed to generate the final binary.
# The project is an initiative of the OpenSSF (openssf.org) and is developed at
# https://github.com/slsa-framework/slsa-github-generator.
# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier.
# For more information about SLSA and how it improves the supply-chain, visit slsa.dev.

name: SLSA Go releaser
on:
workflow_dispatch:
release:
types: [created]

permissions: read-all

jobs:
# Generate ldflags dynamically.
args:
runs-on: ubuntu-latest
outputs:
commit-date: ${{ steps.ldflags.outputs.commit-date }}
commit: ${{ steps.ldflags.outputs.commit }}
version: ${{ steps.ldflags.outputs.version }}
tree-state: ${{ steps.ldflags.outputs.tree-state }}
steps:
- id: checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # tag=v2.3.4
with:
fetch-depth: 0
- id: ldflags
run: |
echo "commit-date=$(git log --date=iso8601-strict -1 --pretty=%ct)" >> "$GITHUB_OUTPUT"
echo "commit=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
echo "version=$(git describe --tags --always --dirty | cut -c2-)" >> "$GITHUB_OUTPUT"
echo "tree-state=$(if git diff --quiet; then echo "clean"; else echo "dirty"; fi)" >> "$GITHUB_OUTPUT"
build:
name: builder-${{matrix.os}}-${{matrix.arch}}
needs: [args]
strategy:
matrix:
os:
- linux
- windows
- darwin
arch:
- amd64
- arm64
permissions:
id-token: write # To sign.
contents: write # To upload release assets.
actions: read # To read workflow path.
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
go-version: "1.20"
config-file: ".slsa-goreleaser/${{matrix.os}}-${{matrix.arch}}.yml"
evaluated-envs: "COMMIT_DATE:${{needs.args.outputs.commit-date}}, COMMIT:${{needs.args.outputs.commit}}, VERSION:${{needs.args.outputs.version}}, TREE_STATE:${{needs.args.outputs.tree-state}}"
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/
33 changes: 33 additions & 0 deletions .slsa-goreleaser/darwin-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: darwin

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: amd64

# (Optional) Entrypoint to compile.
# main: ./path/to/main.go

# (Optional) Working directory. (default: root of the project)
dir: ./internal/cmd/todos

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: todos-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
33 changes: 33 additions & 0 deletions .slsa-goreleaser/darwin-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: darwin

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: arm64

# (Optional) Entrypoint to compile.
# main: ./path/to/main.go

# (Optional) Working directory. (default: root of the project)
dir: ./internal/cmd/todos

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: todos-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
33 changes: 33 additions & 0 deletions .slsa-goreleaser/linux-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: linux

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: amd64

# (Optional) Entrypoint to compile.
# main: ./path/to/main.go

# (Optional) Working directory. (default: root of the project)
dir: ./internal/cmd/todos

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: todos-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
33 changes: 33 additions & 0 deletions .slsa-goreleaser/linux-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: linux

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: arm64

# (Optional) Entrypoint to compile.
# main: ./path/to/main.go

# (Optional) Working directory. (default: root of the project)
dir: ./internal/cmd/todos

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: todos-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
33 changes: 33 additions & 0 deletions .slsa-goreleaser/windows-amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: windows

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: amd64

# (Optional) Entrypoint to compile.
# main: ./path/to/main.go

# (Optional) Working directory. (default: root of the project)
dir: ./internal/cmd/todos

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: todos-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
33 changes: 33 additions & 0 deletions .slsa-goreleaser/windows-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Version for this file.
version: 1

# (Optional) List of env variables used during compilation.
env:
- GO111MODULE=on
- CGO_ENABLED=0

# (Optional) Flags for the compiler.
flags:
- -trimpath
- -tags=netgo

# The OS to compile for. `GOOS` env variable will be set to this value.
goos: windows

# The architecture to compile for. `GOARCH` env variable will be set to this value.
goarch: arm64

# (Optional) Entrypoint to compile.
# main: ./path/to/main.go

# (Optional) Working directory. (default: root of the project)
dir: ./internal/cmd/todos

# Binary output name.
# {{ .Os }} will be replaced by goos field in the config file.
# {{ .Arch }} will be replaced by goarch field in the config file.
binary: todos-{{ .Os }}-{{ .Arch }}

# (Optional) ldflags generated dynamically in the workflow, and set as the `evaluated-envs` input variables in the workflow.
ldflags:
- "-X sigs.k8s.io/release-utils/version.gitVersion={{ .Env.VERSION }}"
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.1] - 2023-05-15

### Added in 0.0.1

- Initial release of `todos` CLI application.
- Simple support for scanning directories for TODO/FIXME/BUG/HACK/XXX comments.

[0.0.1]: https://github.com/olivierlacan/keep-a-changelog/releases/tag/v0.0.1
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# How to contribute

We'd love to accept your patches and contributions to this project.

## Before you begin

### Sign our Contributor License Agreement

Contributions to this project must be accompanied by a
[Contributor License Agreement](https://cla.developers.google.com/about) (CLA).
You (or your employer) retain the copyright to your contribution; this simply
gives us permission to use and redistribute your contributions as part of the
project.

If you or your current employer have already signed the Google CLA (even if it
was for a different project), you probably don't need to do it again.

Visit <https://cla.developers.google.com/> to see your current agreements or to
sign a new one.

### Review our community guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google/conduct/).

## Contribution process

### Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
Loading

0 comments on commit 138eafa

Please sign in to comment.