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

Commit

Permalink
feat: merge github.com/tofuutils/gotofuenv and github.com/tofuutils/tenv
Browse files Browse the repository at this point in the history
  • Loading branch information
kvendingoldo committed Jan 23, 2024
2 parents 0bd971c + 5d4cf90 commit 0c1c498
Show file tree
Hide file tree
Showing 48 changed files with 1,681 additions and 8 deletions.
46 changes: 46 additions & 0 deletions .github/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: 1

before:
hooks:
# You may remove this if you don't use go modules.
- go get ./

builds:
- env:
- CGO_ENABLED=0
binary: tenv
ldflags:
- -s -w
goos:
- linux
- windows
- darwin
ignore:
- goos: darwin
goarch: 386

archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{ .Tag }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- "^test:"

checksum:
name_template: "{{ .ProjectName }}_{{ .Tag }}_checksums.txt"
algorithm: sha256
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See [contributing quick start](todo) on our website.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'issue: bug'

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information):**
- OS: [e.g. iOS]
- tofuenv version [e.g. 0.8.0]

**Additional context**
Add any other context about the problem here.
Empty file.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the issue is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
timezone: "Europe/London"
time: "09:00"
day: "monday"
commit-message:
prefix: "ci:"
3 changes: 3 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!--
Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change.
-->
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: pipeline

on:
push:
branches:
- 'main'
- 'release/**'

env:
registry_url: "registry.hub.docker.com"
image_repo: "tofuutils/tenv"

jobs:
build:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.set_version.outputs.safe_version }}
steps:
-
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker registry
uses: docker/login-action@v3
with:
registry: ${{ env.registry_url }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Set application version
id: set_version
uses: kvendingoldo/[email protected]
with:
primary_branch: 'main'
-
name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: |
${{ env.registry_url }}/${{ env.image_repo }}:latest
${{ env.registry_url }}/${{ env.image_repo }}:${{ steps.set_version.outputs.safe_version }}
-
name: Print image version
run: echo ${{ steps.set_version.outputs.safe_version }}
27 changes: 27 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Codespell

on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
workflow_dispatch:

jobs:
codespell:
name: 'Check for spelling errors'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Codespell
uses: codespell-project/actions-codespell@v2
with:
skip: .git,*.png,*.woff,*.woff2,*.eot,*.ttf,*.jpg,*.ico,*.svg,*.gpg,.*asc
check_filenames: true
check_hidden: true
28 changes: 28 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:
permissions:
contents: read
jobs:
golangci:
name: lint
runs-on: ubuntu-20.04
steps:
-
uses: actions/setup-go@v5
with:
go-version: 1.18
-
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.48
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: 'Release'

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'

permissions:
contents: write

jobs:
goreleaser:
name: 'Release the latest tag'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean -f ${{ vars.GORELEASER_CONFIG_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.TENV_GITHUB_TOKEN }}
29 changes: 26 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
# Dependency directories (remove the comment below to include it)
# vendor/

dist/
versions/
version
.opentofu-version
.terraform-version
bin/tofu-*
bin/terraform-*
/use-gnupg
/use-gpgv
.*.swp

# 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

# Idea
.idea
.DS_Store
38 changes: 38 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
run:
deadline: 1m
skip-files:
- ".*\\.pb\\.go"
skip-dirs:
- pkg/client
modules-download-mode: readonly

linters:
enable-all: true
disable-all: false
disable:
- wsl
- wrapcheck
- goerr113
- gomnd
- exhaustruct
- nestif
- gofumpt
- gochecknoinits
- funlen
- cyclop
- goimports
- gci
- lll
- gocognit
- ifshort # deprecated
- maligned # deprecated
- golint # deprecated
- interfacer #deprecated
- scopelint # deprecated
- exhaustivestruct # deprecated

linters-settings:
gosimple:
checks:
- all
- '-S1024' # disable the rule S1024
Empty file added CHANGELOG.md
Empty file.
Loading

0 comments on commit 0c1c498

Please sign in to comment.