Skip to content

Commit

Permalink
Merge pull request #34 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.0.7
  • Loading branch information
andyone committed Jun 22, 2024
2 parents 7746ee6 + 6e608e4 commit 107857a
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 100 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ updates:
- "andyone"
reviewers:
- "andyone"
groups:
all:
applies-to: version-updates
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
Expand Down
5 changes: 5 additions & 0 deletions .github/images/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/images/godoc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/images/license.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 39 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,52 @@ on:
branches: [master, develop]
pull_request:
branches: [master]
workflow_dispatch:
inputs:
force_run:
description: 'Force workflow run'
required: true
type: choice
options: [yes, no]

permissions:
actions: read
contents: read
statuses: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Go:
name: Go
runs-on: ubuntu-latest

env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto

strategy:
matrix:
go: [ '1.17.x', '1.18.x' ]
go: [ '1.21.x', '1.22.x' ]

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

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

- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{env.SRC_DIR}}

- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
run: make deps-test
run: make deps

- name: Run tests
working-directory: ${{env.SRC_DIR}}
run: go test -v -covermode count -coverprofile cover.out ./...

- name: Send coverage data
uses: essentialkaos/goveralls-action@v1
uses: essentialkaos/goveralls-action@v2
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: ${{env.SRC_DIR}}
profile: cover.out
parallel: true
flag-name: linux-${{ matrix.go }}
Expand All @@ -67,7 +63,7 @@ jobs:

steps:
- name: Finish parallel tests
uses: essentialkaos/goveralls-action@v1
uses: essentialkaos/goveralls-action@v2
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -79,30 +75,30 @@ jobs:

needs: Go

env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.17.x'
id: go

- name: Setup PATH
run: |
echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV"
echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV"
echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH"
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
path: ${{env.SRC_DIR}}
go-version: '1.21.x'

- name: Check Golang sources with Aligo
uses: essentialkaos/aligo-action@v1
uses: essentialkaos/aligo-action@v2
with:
path: ${{env.SRC_DIR}}
files: ./...

Typos:
name: Typos
runs-on: ubuntu-latest

needs: Go

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

- name: Check spelling
continue-on-error: true
uses: crate-ci/typos@master
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[files]
extend-exclude = ["go.sum"]
95 changes: 76 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,104 @@
################################################################################

# This Makefile generated by GoMakeGen 1.5.1 using next command:
# This Makefile generated by GoMakeGen 3.0.2 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen

################################################################################

export GO111MODULE=on
ifdef VERBOSE ## Print verbose information (Flag)
VERBOSE_FLAG = -v
endif

COMPAT ?= 1.19
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)

################################################################################

.DEFAULT_GOAL := help
.PHONY = fmt vet deps deps-test test mod-init mod-update mod-vendor help
.PHONY = fmt vet deps update test init vendor mod-init mod-update mod-download mod-vendor help

################################################################################

deps: mod-update ## Download dependencies
init: mod-init ## Initialize new module

deps: mod-download ## Download dependencies

update: mod-update ## Update dependencies to the latest versions

deps-test: deps ## Download dependencies for tests
vendor: mod-vendor ## Make vendored copy of dependencies

test: ## Run tests
go test -covermode=count .
@echo "Starting tests…"
ifdef COVERAGE_FILE ## Save coverage data into file (String)
@go test $(VERBOSE_FLAG) -covermode=count -coverprofile=$(COVERAGE_FILE) .
else
@go test $(VERBOSE_FLAG) -covermode=count .
endif

mod-init:
@echo "[1/2] Modules initialization…"
ifdef MODULE_PATH ## Module path for initialization (String)
@go mod init $(MODULE_PATH)
else
@go mod init
endif

@echo "[2/2] Dependencies cleanup…"
ifdef COMPAT ## Compatible Go version (String)
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
else
@go mod tidy $(VERBOSE_FLAG)
endif

mod-update:
@echo "[1/4] Updating dependencies…"
ifdef UPDATE_ALL ## Update all dependencies (Flag)
@go get -u $(VERBOSE_FLAG) all
else
@go get -u $(VERBOSE_FLAG) ./...
endif

@echo "[2/4] Stripping toolchain info…"
@grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || :

@echo "[3/4] Dependencies cleanup…"
ifdef COMPAT
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
else
@go mod tidy $(VERBOSE_FLAG)
endif

mod-init: ## Initialize new module
go mod init
go mod tidy
@echo "[4/4] Updating vendored dependencies…"
@test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

mod-update: ## Download modules to local cache
go mod download
mod-download:
@echo "Downloading dependencies…"
@go mod download

mod-vendor: ## Make vendored copy of dependencies
go mod vendor
mod-vendor:
@echo "Vendoring dependencies…"
@rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;
@echo "Formatting sources…"
@find . -name "*.go" -exec gofmt -s -w {} \;

vet: ## Runs go vet over sources
go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
vet: ## Runs 'go vet' over sources
@echo "Running 'go vet' over sources…"
@go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...

help: ## Show this info
@echo -e '\n\033[1mSupported targets:\033[0m\n'
@echo -e '\n\033[1mTargets:\033[0m\n'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-6s\033[0m %s\n", $$1, $$2}'
@echo -e '\n\033[1mVariables:\033[0m\n'
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
| sed 's/ifdef //' \
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-13s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n'

################################################################################
26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
<p align="center"><a href="#readme"><img src="https://gh.kaos.st/go-jar.svg"/></a></p>
<p align="center"><a href="#readme"><img src=".github/images/card.svg"/></a></p>

<p align="center">
<a href="https://kaos.sh/g/go-jar"><img src="https://gh.kaos.st/godoc.svg" alt="PkgGoDev" /></a>
<a href="https://kaos.sh/g/go-jar"><img src=".github/images/godoc.svg"/></a>
<a href="https://kaos.sh/r/go-jar"><img src="https://kaos.sh/r/go-jar.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/w/go-jar/ci"><img src="https://kaos.sh/w/go-jar/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/w/go-jar/codeql"><img src="https://kaos.sh/w/go-jar/codeql.svg" alt="GitHub Actions CodeQL Status" /></a>
<a href="https://kaos.sh/w/go-jar/codeql"><img src="https://kaos.sh/w/go-jar/codeql.svg" alt="GitHub Actions CodeQL Status" /></a><br/>
<a href="https://kaos.sh/c/go-jar"><img src="https://kaos.sh/c/go-jar.svg" alt="Coverage Status" /></a>
<a href="https://kaos.sh/b/go-jar"><img src="https://kaos.sh/b/eafd2393-ab11-4d0e-bdc3-e51613c9e38a.svg" alt="Codebeat badge" /></a>
<a href="#license"><img src="https://gh.kaos.st/apache2.svg"></a>
<a href="#license"><img src=".github/images/license.svg"/></a>
</p>

<p align="center"><a href="#installation">Installation</a> • <a href="#build-status">Build Status</a> • <a href="#license">License</a></p>
<p align="center"><a href="#ci-status">CI Status</a> • <a href="#license">License</a></p>

<br/>

`jar` is a very simple Go package for reading manifest data from JAR files.

### Installation

Make sure you have a working Go 1.17+ workspace (_[instructions](https://golang.org/doc/install)_), then:

```
go get -d github.com/essentialkaos/go-jar
```

For update to the latest stable release, do:

```
go get -d -u github.com/essentialkaos/go-jar
```

### Build Status
### CI Status

| Branch | Status |
|--------|----------|
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/essentialkaos/go-jar

go 1.17
go 1.18

require github.com/essentialkaos/check v1.3.0
require github.com/essentialkaos/check v1.4.0

require (
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.6.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
)
19 changes: 8 additions & 11 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/essentialkaos/check v1.3.0 h1:ria+8o22RCLdt2D/1SHQsEH5Mmy5S+iWHaGHrrbPUc0=
github.com/essentialkaos/check v1.3.0/go.mod h1:PhxzfJWlf5L/skuyhzBLIvjMB5Xu9TIyDIsqpY5MvB8=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk=
github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=

0 comments on commit 107857a

Please sign in to comment.