generated from emmeowzing/base
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7147429
Showing
11 changed files
with
897 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
README.md | ||
LICENSE | ||
renovate.json | ||
.pre-commit-config.yaml | ||
.github/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
default: | ||
docker: | ||
- image: cimg/base:stable | ||
|
||
commands: | ||
increment-minor-tag: | ||
steps: | ||
- run: | ||
name: Autoincrement repository's latest tag minor version | ||
command: |+ | ||
git fetch --all --tags | ||
RES="$(git show-ref --tags)" | ||
if [ -z "$RES" ]; then | ||
NEW_TAG="v1.0.0" | ||
else | ||
mapfile -d " " -t LATEST_TAG < <(git tag | sort -V | tail -1 | sed 's/\./ /g') | ||
if [ "${#LATEST_TAG[@]}" -ne 3 ]; then | ||
printf "Must follow semver convention /v?[0-9]{3}.[0-9]{3}.[0-9]{3}/ to parse.\\n" 1>&2 | ||
exit 1 | ||
fi | ||
one="${LATEST_TAG[0]//v/}" | ||
two="${LATEST_TAG[1]}" | ||
three="${LATEST_TAG[2]}" | ||
# Increment versions mod 1k. | ||
if [ "$three" == "999" ]; then | ||
if [ "$two" == "999" ]; then | ||
three=0 | ||
two=0 | ||
((one++)) | ||
else | ||
((two++)) | ||
three=0 | ||
fi | ||
elif [ "$two" == "999" ] && [ "$three" == "999" ]; then | ||
((one++)) | ||
two=0 | ||
else | ||
((three++)) | ||
fi | ||
NEW_TAG="v${one}.${two}.${three}" | ||
fi | ||
git tag "$NEW_TAG" | ||
git push origin "$NEW_TAG" | ||
release: | ||
steps: | ||
- run: | ||
name: Generate release | ||
command: |+ | ||
# Get latest tag. | ||
git fetch --all --tags | ||
export LATEST_TAG="$(git tag | sort -V | tail -1)" | ||
echo "$LATEST_TAG" | ||
# Generate release from tag. | ||
echo "$GITHUB_TOKEN" | gh auth login --with-token 2>/dev/null || true | ||
gh release create "$LATEST_TAG" --generate-notes | ||
jobs: | ||
autoincrement-minor-tag: | ||
executor: default | ||
resource_class: small | ||
steps: | ||
- checkout | ||
- add_ssh_keys: | ||
fingerprints: | ||
- FIXME | ||
- increment-minor-tag | ||
|
||
generate-release: | ||
executor: default | ||
resource_class: small | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install gh CLI | ||
command: |+ | ||
wget https://github.com/cli/cli/releases/download/v2.9.0/gh_2.9.0_linux_amd64.deb -O gh.deb | ||
sudo dpkg -i gh.deb | ||
- release | ||
|
||
hello: | ||
executor: default | ||
resource_class: small | ||
steps: | ||
- run: | ||
name: Hello | ||
command: echo hello | ||
|
||
workflows: | ||
version: 2 | ||
|
||
on-tag: | ||
jobs: | ||
- hello: | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ | ||
|
||
on-merge: | ||
jobs: | ||
# Auto-increment minor tag to kick off on-tag workflow. | ||
- autoincrement-minor-tag: | ||
filters: | ||
branches: | ||
only: master | ||
|
||
# Generate a release from the latest tag. | ||
- generate-release: | ||
context: github | ||
filters: | ||
branches: | ||
only: master | ||
requires: | ||
- autoincrement-minor-tag | ||
|
||
on-commit: | ||
jobs: | ||
- hello: | ||
filters: | ||
branches: | ||
ignore: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: 2.1 | ||
|
||
setup: true | ||
|
||
orbs: | ||
dynamic: bjd2385/[email protected] | ||
|
||
workflows: | ||
version: 2 | ||
|
||
default: | ||
jobs: | ||
- dynamic/extend: | ||
context: orb-publishing | ||
modules: | | ||
. | ||
scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
shellcheck: circleci/[email protected] | ||
|
||
executors: | ||
default: | ||
docker: | ||
- image: cimg/base:stable | ||
|
||
workflows: | ||
version: 2 | ||
|
||
on-commit: | ||
jobs: | ||
- shellcheck/check: | ||
dir: ./src/scripts | ||
exclude: SC2148 | ||
filters: | ||
branches: | ||
ignore: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
ko_fi: bjd2385 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_extends: .github | ||
|
||
repository: | ||
name: base | ||
description: Base repository with default settings and configs | ||
homepage: github.com | ||
|
||
# A comma-separated list of topics to set on the repository | ||
topics: settings | ||
private: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: trailing-whitespace | ||
args: [--markdown-linebreak-ext=md] | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
|
||
- repo: https://github.com/bjd2385/circleci-orb-pre-commit-hook | ||
rev: v1.2.0 | ||
hooks: | ||
- id: circleci-orb-validate | ||
args: | ||
- src # Target the src/ directory. | ||
- "true" # Enable pre-pack prior to validation. | ||
|
||
- repo: https://github.com/bjd2385/circleci-config-pre-commit-hook | ||
rev: v1.0.3 | ||
hooks: | ||
- id: circleci-config-validate |
Oops, something went wrong.