Skip to content

Commit

Permalink
init: added all files
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywolf132 committed Nov 26, 2024
0 parents commit 8ec1c35
Show file tree
Hide file tree
Showing 13 changed files with 1,485 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.19', '1.20', '1.21']

steps:
- uses: actions/checkout@v3

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

- name: Get dependencies
run: go mod download

- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.go-version }}
path: coverage.out

build:
name: Build
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
go-version: ['1.21']
platform: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3

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

- name: Get dependencies
run: go mod download

- name: Build
run: go build -v ./...
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Create Release

on:
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.0.0)'
required: true
type: string

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Get dependencies
run: go mod download

- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...

build-and-release:
name: Create Release
needs: test
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Get dependencies
run: go mod download

- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -o secret-fetch-linux-amd64 ./...
GOOS=darwin GOARCH=amd64 go build -o secret-fetch-darwin-amd64 ./...
GOOS=windows GOARCH=amd64 go build -o secret-fetch-windows-amd64.exe ./...
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
draft: false
prerelease: false
body: |
Release ${{ github.event.inputs.version }}
## What's Changed
* Please update these release notes manually
## Installation
```bash
go get github.com/crazywolf132/SecretFetch@${{ github.event.inputs.version }}
```
- name: Upload Linux Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./secret-fetch-linux-amd64
asset_name: secret-fetch-linux-amd64
asset_content_type: application/octet-stream

- name: Upload macOS Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./secret-fetch-darwin-amd64
asset_name: secret-fetch-darwin-amd64
asset_content_type: application/octet-stream

- name: Upload Windows Binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./secret-fetch-windows-amd64.exe
asset_name: secret-fetch-windows-amd64.exe
asset_content_type: application/octet-stream
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

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

# Output of the go coverage tool
*.out
coverage.out

# Dependency directories
vendor/

# Go workspace file
go.work

# IDE specific files
.idea/
.vscode/
*.swp
*.swo

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributing to SecretFetch

We love your input! We want to make contributing to SecretFetch as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

## We Develop with Github
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.

## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html)
Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. Issue that pull request!

## Any contributions you make will be under the MIT Software License
In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.

## Report bugs using Github's [issue tracker](https://github.com/crazywolf132/SecretFetch/issues)
We use GitHub issues to track public bugs. Report a bug by [opening a new issue](https://github.com/crazywolf132/SecretFetch/issues/new); it's that easy!

## Write bug reports with detail, background, and sample code

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## License
By contributing, you agree that your contributions will be licensed under its MIT License.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Brayden

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.PHONY: all build test lint clean install-tools

GO := go
GOFLAGS := -v
BINARY_NAME := secretfetch
COVERAGE_FILE := coverage.out

all: lint test build

build:
$(GO) build $(GOFLAGS) ./...

test:
$(GO) test $(GOFLAGS) -race -coverprofile=$(COVERAGE_FILE) ./...
$(GO) tool cover -func=$(COVERAGE_FILE)

lint: install-tools
revive -config revive.toml ./...
$(GO) vet ./...

clean:
$(GO) clean
rm -f $(COVERAGE_FILE)
rm -f $(BINARY_NAME)

install-tools:
@which revive > /dev/null || $(GO) install github.com/mgechev/revive@latest

.DEFAULT_GOAL := all
Loading

0 comments on commit 8ec1c35

Please sign in to comment.