Skip to content

Commit

Permalink
Add workflow files and banner
Browse files Browse the repository at this point in the history
  • Loading branch information
gateixeira committed May 5, 2023
1 parent 3cc8321 commit 50b2932
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- gateixeira
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
reviewers:
- gateixeira
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Build
run: make build
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*.*.*

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 0 additions & 2 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: "Generate Licenses Report"
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:

permissions:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bin/
.DS_Store
report.html
enterprise-licenses-report
enterprise-licenses-report
dist/
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
clean:
rm -rf dist/
build:
go build -o bin/enterprise-licenses-report main.go
compile:
GOOS=linux GOARCH=arm go build -o bin/enterprise-licenses-report-linux-arm main.go
GOOS=linux GOARCH=amd64 go build -o bin/enterprise-licenses-report-linux-amd64 main.go
GOOS=windows GOARCH=amd64 go build -o bin/enterprise-licenses-report-windows-amd64 main.go
GOOS=darwin GOARCH=arm64 go build -o bin/enterprise-licenses-report-darwin-arm64 main.go
go build -o dist/gei-migration-helper main.go
snapshot:
goreleaser release --snapshot
release:
goreleaser release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Or set it up as an Action workflow:

```yml
- name: Generate Report
uses: ./
uses: gateixeira/enterprise-licenses-report@main
env:
GITHUB_ENTERPRISE_SLUG: "<enterprise_slug>"
GITHUB_PAT: ${{ secrets.PAT }}
Expand Down
10 changes: 10 additions & 0 deletions cmd/banner.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
o.OOoOoo o `OooOOo.
O o O o o `o
o O o O O O
ooOO oOo o o .O oOo
O 'OoOo. o .oOo. `OoOo. .oOo. `OoOo. O .oOo .oOo. O O .oOo .oOo. 'OoOo. .oOo .oOo. .oOo OOooOO' .oOo. .oOo. .oOo. `OoOo. o
o o O O OooO' o O o o o `Ooo. OooO' O o O OooO' o O `Ooo. OooO' `Ooo. o o OooO' O o O o o O
O O o o O O o O O O O O o . O o O O o O O O O O O o O o O O o
ooOooOoO o O `oO `OoO' o oOoO' o o' `OoO' `OoO' OOoOooO o' `OoO' `OoO' o O `OoO' `OoO' `OoO' O o `OoO' oOoO' `OoO' o `oO
O O
o' o'
9 changes: 9 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright © 2023 NAME HERE <EMAIL ADDRESS>
package cmd

import (
_ "embed"
"os"

"github.com/spf13/cobra"
Expand All @@ -18,6 +19,9 @@ const (
repositoryFlagName = "repository"
)

//go:embed banner.txt
var banner []byte

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "enterprise-licenses-report",
Expand All @@ -38,6 +42,11 @@ func Execute() {
}

func init() {
rootCmd.SetOut(os.Stdout)
rootCmd.SetErr(os.Stderr)
rootCmd.Version = VERSION
rootCmd.Println("\n\n" + string(banner) + "\n\n")

// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
Copyright © 2023 @gateixeira
*/
package main

Expand Down

0 comments on commit 50b2932

Please sign in to comment.