Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 232c4a1eb7 | |||
| 31f37f73cb | |||
| 4eb5cc0564 | |||
| 4672526676 | |||
| bfdbec97e9 |
13
.gitlab-ci.yml
Normal file
13
.gitlab-ci.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# You can override the included template(s) by including variable overrides
|
||||||
|
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
|
||||||
|
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
|
||||||
|
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
|
||||||
|
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
|
||||||
|
# Note that environment variables can be set in several places
|
||||||
|
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
sast:
|
||||||
|
stage: test
|
||||||
|
include:
|
||||||
|
- template: Security/SAST.gitlab-ci.yml
|
||||||
35
README.md
35
README.md
@@ -21,3 +21,38 @@ tracked files, the diff will be hashed and added to the metadata.
|
|||||||
|
|
||||||
Tags which begin with a 'v' will have it removed when evaluating the tag as a
|
Tags which begin with a 'v' will have it removed when evaluating the tag as a
|
||||||
version.
|
version.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Add it to your project as a submodule:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git submodule add https://git.sdf.org/CRThaze/git-semver-compute.git .version
|
||||||
|
```
|
||||||
|
|
||||||
|
### Makefile
|
||||||
|
|
||||||
|
Easily make the current version available in your Makefile like so:
|
||||||
|
|
||||||
|
```make
|
||||||
|
# Use the ?= to allow the version to be overriden easily by passing it in as
|
||||||
|
# an environment or build variable.
|
||||||
|
VERSION ?= $(shell ./.version/calculate-version.sh)
|
||||||
|
|
||||||
|
$(EXECUTABLE):
|
||||||
|
go build -ldflags="-X main.Version=$(VERSION)" -o $(EXECUTABLE) .
|
||||||
|
```
|
||||||
|
|
||||||
|
### Github Actions
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
steps:
|
||||||
|
- name: Compute SemVer from Tags and Commits
|
||||||
|
id: version
|
||||||
|
run: echo "VERSION=$(${PWD}/.version/calculate-version.sh)" >> $GITHUB_OUTPUT
|
||||||
|
- name: Create Archive
|
||||||
|
run: tar -czf mycode-${{ steps.version.outputs.VERSION }}.tar.gz .
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user