Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Mar 13, 2024
0 parents commit 19b37b0
Show file tree
Hide file tree
Showing 11 changed files with 1,263 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
### Header #########################################################################################

# Author: Florian Bernd
# Source: https://github.com/zysharp/templates

### Common Settings ################################################################################

# Documentation:
# http://docs.editorconfig.org/en/master/editorconfig-format.html

# This file is the top-most EditorConfig file
root = true

### All Files --------------------------------------------------------------------------------------

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

### File Extension Settings ------------------------------------------------------------------------

# XML Configuration Files
[*.{xml,config}]
indent_size = 2

# JSON Files
[*.{json,json5,webmanifest}]
indent_size = 2

# YAML Files
[*.{yml,yaml}]
indent_size = 2

# Markdown Files
[*.{md,mdx}]
indent_size = 2
trim_trailing_whitespace = false

# Web Files
[*.{htm,html,js,jsm,jsx,ts,tsx,cjs,cts,ctsx,mjs,mts,mtsx,css,sass,scss,less,pcss,svg,vue}]
indent_size = 2

# Batch Scripts
[*.{bat,cmd,ps1}]
end_of_line = crlf

# Bash Scripts
[*.{bash,fish,sh,zsh}]
end_of_line = lf

# Makefiles
[Makefile]
indent_style = tab

### ------------------------------------------------------------------------------------------------

### License ########################################################################################

# The MIT License (MIT)
#
# Copyright (c) 2022 Florian Bernd
#
# 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.

####################################################################################################
103 changes: 103 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
### Header #########################################################################################

# Author: Florian Bernd
# Source: https://github.com/zysharp/templates

### Git Line Endings ###############################################################################

# Set default behavior to automatically normalize line endings
* text=auto

# Documents
*.md text diff=markdown
*.mdx text diff=markdown

# Serialization
*.json text
*.toml text
*.xml text
*.yml text linguist-language=YAML linguist-detectable -linguist-vendored
*.yaml text linguist-language=YAML linguist-detectable -linguist-vendored

# Graphics
*.eps binary
*.gif binary
*.ico binary
*.jpg binary
*.jpeg binary
*.png binary
*.tif binary
*.tiff binary

# Force batch scripts to always use CRLF line endings
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf

# Force bash scripts to always use LF line endings
*.bash text eol=lf
*.fish text eol=lf
*.sh text eol=lf
*.zsh text eol=lf

# Text files where line endings should be preserved
*.patch -text

### TypeScript / JavaScript ########################################################################

*.js text
*.jsx text
*.ts text
*.tsx text

### Python #########################################################################################

# Source
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python
*.pyi text diff=python

# Binary
*.db binary
*.p binary
*.pkl binary
*.pickle binary
*.pyc binary export-ignore
*.pyo binary export-ignore
*.pyd binary

### Exclude files from exporting ###################################################################

.gitattributes export-ignore
.gitignore export-ignore
.gitkeep export-ignore

### License ########################################################################################

# The MIT License (MIT)
#
# Copyright (c) 2022 Florian Bernd
#
# 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.

####################################################################################################
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Documentation
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: 'daily'
open-pull-requests-limit: 10
110 changes: 110 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: 'CI'

on:
push:
branches:
- 'master'
pull_request:
types:
- 'opened'
- 'synchronize'
- 'reopened'

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

jobs:
test:
name: 'Test'
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- 'ubuntu-latest'
- 'macos-latest'
- 'windows-latest'
steps:
- name: 'Checkout'
uses: 'actions/checkout@v4'

- name: 'TEST: Parse Version'
id: test1
uses: './.'
with:
version: '1.2.3-alpha.1+build'

- name: 'FAILED: Parse Version'
if: |
steps.test1.outputs.valid != 'true' ||
steps.test1.outputs.version != '1.2.3-alpha.1+build' ||
steps.test1.outputs.major != '1' ||
steps.test1.outputs.minor != '2' ||
steps.test1.outputs.patch != '3' ||
steps.test1.outputs.prerelease != 'alpha.1' ||
steps.test1.outputs.build != 'build'
run: |-
echo ":error ::Test failed"
echo "${{ toJSON(steps.test1.outputs) }}"
exit 1
- name: 'TEST: Parse Version from Ref'
id: test2
uses: './.'
with:
version: 'refs/tags/1.2.3-alpha.1+build'

- name: 'FAILED: Parse Version'
if: |
steps.test2.outputs.valid != 'true' ||
steps.test2.outputs.version != '1.2.3-alpha.1+build' ||
steps.test2.outputs.major != '1' ||
steps.test2.outputs.minor != '2' ||
steps.test2.outputs.patch != '3' ||
steps.test2.outputs.prerelease != 'alpha.1' ||
steps.test2.outputs.build != 'build'
run: |-
echo ":error ::Test failed"
echo "${{ toJSON(steps.test2.outputs) }}"
exit 1
- name: 'TEST: Parse Version with Prefix'
id: test3
uses: './.'
with:
version: 'v1.2.3-alpha.1+build'
prefixes: |-
a
v
b
- name: 'FAILED: Parse Version'
if: |
steps.test3.outputs.valid != 'true' ||
steps.test3.outputs.version != '1.2.3-alpha.1+build' ||
steps.test3.outputs.major != '1' ||
steps.test3.outputs.minor != '2' ||
steps.test3.outputs.patch != '3' ||
steps.test3.outputs.prerelease != 'alpha.1' ||
steps.test3.outputs.build != 'build'
run: |-
echo ":error ::Test failed"
echo "${{ toJSON(steps.test3.outputs) }}"
exit 1
- name: 'TEST: Fail on Error'
id: test4
uses: './.'
with:
version: 'invalid-version'
fail_on_error: false

- name: 'FAILED: Parse Version'
if: |
steps.test4.outputs.valid != 'false'
run: |-
echo ":error ::Test failed"
echo "${{ toJSON(steps.test4.outputs) }}"
exit 1
14 changes: 14 additions & 0 deletions .github/workflows/update_semver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Update Floating Version Tags'

on:
release:
types:
- 'published'

jobs:
update-semver:
name: 'Update Tags'
runs-on: 'ubuntu-latest'
steps:
- name: 'Update Floating Version Tags'
uses: zyactions/update-semver@v1
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 ZyActions

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.
Loading

0 comments on commit 19b37b0

Please sign in to comment.