Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebeazer committed Jan 10, 2024
1 parent 865cbb8 commit 68d0705
Show file tree
Hide file tree
Showing 23 changed files with 877 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
steps:
- group: ":test_tube: Test"
key: "test"
steps:
- label: ":lab_coat: Unit Tests"
command: "earthly +test"
plugins:
- test-collector#v1.0.0:
files: "junit-results.xml"
format: "junit"
- label: ":goggles: Code Coverage"
command: "earthly +coverage"
artifact_paths:
- coverage.out
- wait: ~
- label: ":arrow_up: Uploading to Codecov"
command: codecov
plugins:
- artifacts:
download: coverage.out
- group: ":hammer: Build"
key: "build"
steps:
- label: ":hammer: Building"
command: "earthly +build"
26 changes: 26 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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/

.idea/

coverage.xml

pkgs/jsonToXml/failedXml.xml

pkgs/jsonToXml/successTest.xml
/dist/

dist/
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global rule:
* @eddiebeazer
65 changes: 65 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
autolabeler:
- label: 'chore'
title:
- '/build[!]?:/i'
- '/docs[!]?:/i'
- '/perf[!]?:/i'
- '/refactor[!]?:/i'
- '/style[!]?:/i'
- '/test[!]?:/i'
- label: 'bug'
title:
- '/fix[!]?:/i'
- label: 'enhancement'
title:
- '/feat[!]?:/i'
- label: 'major'
title:
- '/.{2}[!]:/i'
- label: 'minor'
title:
- '/feat:/i'
- label: 'patch'
title:
- '/fix[!]?:/i'
- label: 'skip-changelog'
title:
- '/ci[!]?:/i'
- '/revert[!]?:/i'
- '/build[!]?:/i'
- '/docs[!]?:/i'
- '/style[!]?:/i'
- '/test[!]?:/i'
exclude-labels:
- 'skip-changelog'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE'
change-title-escapes: '\<*_&'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
24 changes: 24 additions & 0 deletions .github/workflows/ReleaseDrafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request_target:
types: [opened, reopened, edited, synchronize]
branches:
- main

permissions:
contents: read

jobs:
ReleaseDrafter:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@09c613e259eb8d4e7c81c2cb00618eb5fc4575a7 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/SecretScanner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Secret Scanner
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
TruffleHog:
name: Secrets Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug --only-verified
19 changes: 19 additions & 0 deletions .github/workflows/ValidatePullRequestTitle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Lint PR"

on:
pull_request_target:
types: [opened, reopened, edited, synchronize]
branches:
- main

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build

on:
workflow_dispatch:
push:
tags:
- '*'

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
with:
go-version: '1.20'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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/

.idea/

coverage.xml

pkgs/jsonToXml/failedXml.xml

pkgs/jsonToXml/successTest.xml
/dist/

dist/
31 changes: 31 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
archives:
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
29 changes: 29 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
VERSION 0.7
FROM golang:1.21
WORKDIR /app

deps:
COPY go.mod go.sum ./
RUN go mod download
RUN go install github.com/jstemmer/go-junit-report/v2@latest
RUN go install github.com/goreleaser/goreleaser@latest
# Output these back in case go mod download changes them.
SAVE ARTIFACT go.mod AS LOCAL go.mod
SAVE ARTIFACT go.sum AS LOCAL go.sum

test:
FROM +deps
COPY . .
RUN go test -v 2>&1 ./... | go-junit-report -set-exit-code > ./junit-results.xml
SAVE ARTIFACT junit-results.xml AS LOCAL junit-results.xml

coverage:
FROM +deps
COPY . .
RUN go test ./... -race -coverprofile=coverage.out -covermode=atomic
SAVE ARTIFACT coverage.out AS LOCAL coverage.out

build:
FROM +deps
COPY . .
RUN goreleaser release --snapshot --clean
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

The MIT License (MIT)

Copyright (c) 2023 Edward Beazer

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.
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# flutter-cli-tools
# unreal-ci
[![License](https://img.shields.io/github/license/eddiebeazer/unreal-ci?color=blue)](https://opensource.org/license/mit/)

[![codecov](https://codecov.io/gh/eddiebeazer/unreal-ci/graph/badge.svg?token=N622BZP1RR)](https://codecov.io/gh/eddiebeazer/unreal-ci)

[![Build status](https://badge.buildkite.com/a90cdd645739568fa23c96aaebb46e5e06b0b03d87f6961e67.svg)](https://buildkite.com/the-digital-sages/unreal-ci)

[![Go Report Card](https://goreportcard.com/badge/github.com/eddiebeazer/unreal-ci)](https://goreportcard.com/report/github.com/eddiebeazer/unreal-ci)

## What Unreal CI does

This is a commandline tool that's acts as a companion to the [ue4cli](https://docs.adamrehn.com/ue4cli/overview/introduction-to-ue4cli)
tool. I mainly created a separate tool because this tool was designed to help out with more niche workflows such as
updating your projects version, parsing lint reports from [LinterV2](https://www.unrealengine.com/marketplace/en-US/product/linter-v2?sessionInvalidated=true),
cleaning your archive directory when building and parsing JSON produced from the built-in uat test tool into JUnit format
for test parsing. I use this in my pipelines for all of my games and tools. As my workload increases, I'll add in any
functionally that feels useful for other people to use

## Installation

This CLI can be used with Go installed on your system or through a docker container. The tool will assume that you are using
it in your projects root directory(directory with your *.uproject file in it), if you aren't you need to specify paths
which will be listed below.

### Go install

```
go install https://github.com/TheDigitalSages/unreal-ci
unreal-ci help
```

### Docker

This image was mainly meant to be used as a CI image for GitHub actions, TeamCity, Jenkins, etc.
Loading

0 comments on commit 68d0705

Please sign in to comment.