Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/go-kit/kit-…
Browse files Browse the repository at this point in the history
…0.12.0
  • Loading branch information
dopey authored Oct 24, 2023
2 parents aa43968 + 7c280be commit c5c5301
Show file tree
Hide file tree
Showing 14 changed files with 278 additions and 257 deletions.
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "needs triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: steps
attributes:
label: Steps to Reproduce
description: Tell us how to reproduce this issue.
placeholder: These are the steps!
validations:
required: true
- type: textarea
id: your-env
attributes:
label: Your Environment
value: |-
* OS -
* Version -
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
description: What did you expect to happen?
validations:
required: true
- type: textarea
id: actual-behavior
attributes:
label: Actual Behavior
description: What happens instead?
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional Context
description: Add any other context about the problem here.
validations:
required: false
- type: textarea
id: contributing
attributes:
label: Contributing
value: |
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Ask on Discord
url: https://discord.gg/7xgjhVAg6g
about: You can ask for help here!
- name: Want to contribute to scep?
url: https://github.com/smallstep/cli/blob/master/docs/CONTRIBUTING.md
about: Be sure to read contributing guidelines!
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Documentation Request
about: Request documentation for a feature
title: ''
labels: docs, needs triage
assignees: ''

---

<!---
Tell us which feature you'd like to see documented.
- Where would you like that documentation to live (command line usage output, website, github markdown on the repo)?
- If there are specific attributes or options you'd like to see documented, please include those in the request.
-->
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Enhancement
about: Suggest an enhancement to scep
title: ''
labels: enhancement, needs triage
assignees: ''

---

### What would you like to be added


### Why this is needed
20 changes: 20 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!---
Please provide answers in the spaces below each prompt, where applicable.
Not every PR requires responses for each prompt.
Use your discretion.
-->
#### Name of feature:

#### Pain or issue this feature alleviates:

#### Why is this important to the project (if not answered above):

#### Is there documentation on how to use this feature? If so, where?

#### In what environments or workflows is this feature supported?

#### In what environments or workflows is this feature explicitly NOT supported (if any)?

#### Supporting links/other PRs/issues:

💔Thank you!
41 changes: 15 additions & 26 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,21 @@ name: CI

on:
push:
branches: [ main ]
tags-ignore:
- 'v*'
branches:
- "main"
pull_request:
types: [opened, reopened, synchronize]
workflow_call:

jobs:
build-test:
name: Build, test & format
strategy:
matrix:
go-version: [1.15.x, 1.16.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2

- name: setup go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: go build -v ./...
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

- name: Test
run: go test -v ./...

- name: Format
if: matrix.platform == 'ubuntu-latest'
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
jobs:
ci:
uses: smallstep/workflows/.github/workflows/goCI.yml@main
with:
run-build: false
run-codeql: true
secrets: inherit
38 changes: 38 additions & 0 deletions .github/workflows/ci-legacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# keeping the legacy CI around for backwards compatibility checks on v1
name: CI (Legacy)

on:
push:
branches: [ main ]
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build-test:
name: Build, test & format
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.18.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3

- name: setup go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...

- name: Format
if: matrix.platform == 'ubuntu-latest'
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
7 changes: 7 additions & 0 deletions .github/workflows/code-scan-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
on:
schedule:
- cron: '0 0 * * SUN'

jobs:
code-scan:
uses: smallstep/workflows/.github/workflows/code-scan.yml@main
22 changes: 22 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create Release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
ci:
uses: smallstep/crypto/.github/workflows/ci.yml@master
secrets: inherit

create_release:
name: Create Release
needs: ci
runs-on: ubuntu-latest
steps:
- name: Is Pre-release
id: is_prerelease
run: |
set +e
echo ${{ github.ref }} | grep "\-rc.*"
OUT=$?
if [ $OUT -eq 0 ]; then IS_PRERELEASE=true; else IS_PRERELEASE=false; fi
echo "IS_PRERELEASE=${IS_PRERELEASE}" >> ${GITHUB_OUTPUT}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
16 changes: 16 additions & 0 deletions .github/workflows/triage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Add Issues and PRs to Triage

on:
issues:
types:
- opened
- reopened
pull_request_target:
types:
- opened
- reopened

jobs:
triage:
uses: smallstep/workflows/.github/workflows/triage.yml@main
secrets: inherit
25 changes: 23 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,23 @@
scepserver-*
scepclient-*
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Go Workspaces
go.work
go.work.sum

# Development
.vscode/
coverage.cov

# 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
45 changes: 1 addition & 44 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,8 @@
VERSION=$(shell git describe --tags --always --dirty)
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
OSARCH=$(shell go env GOHOSTOS)-$(shell go env GOHOSTARCH)

SCEPCLIENT=\
scepclient-linux-amd64 \
scepclient-linux-arm \
scepclient-darwin-amd64 \
scepclient-darwin-arm64 \
scepclient-freebsd-amd64 \
scepclient-windows-amd64.exe

SCEPSERVER=\
scepserver-linux-amd64 \
scepserver-linux-arm \
scepserver-darwin-amd64 \
scepserver-darwin-arm64 \
scepserver-freebsd-amd64 \
scepserver-windows-amd64.exe

my: scepclient-$(OSARCH) scepserver-$(OSARCH)

docker: scepclient-linux-amd64 scepserver-linux-amd64

$(SCEPCLIENT):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepclient

$(SCEPSERVER):
GOOS=$(word 2,$(subst -, ,$@)) GOARCH=$(word 3,$(subst -, ,$(subst .exe,,$@))) go build $(LDFLAGS) -o $@ ./cmd/scepserver

%-$(VERSION).zip: %.exe
rm -f $@
zip $@ $<

%-$(VERSION).zip: %
rm -f $@
zip $@ $<

release: $(foreach bin,$(SCEPCLIENT) $(SCEPSERVER),$(subst .exe,,$(bin))-$(VERSION).zip)

clean:
rm -f scepclient-* scepserver-*

test:
go test -cover ./...

# don't run race tests by default. see https://github.com/etcd-io/bbolt/issues/187
test-race:
go test -cover -race ./...

.PHONY: my docker $(SCEPCLIENT) $(SCEPSERVER) release clean test test-race
.PHONY: test test-race
Loading

0 comments on commit c5c5301

Please sign in to comment.