-
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 9361206
Showing
23 changed files
with
13,956 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,20 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.php] | ||
indent_size = 4 | ||
|
||
[*.scss] | ||
indent_size = 2 | ||
|
||
[*.js] | ||
indent_size = 2 |
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,15 @@ | ||
/.github export-ignore | ||
/build export-ignore | ||
/tests export-ignore | ||
/.editorconfig export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.php-cs-fixer.php export-ignore | ||
/.releaserc export-ignore | ||
/CHANGELOG.md export-ignore | ||
/LICENSE export-ignore | ||
/README.md export-ignore | ||
/package.json export-ignore | ||
/package-lock.json export-ignore | ||
/phpcs.xml export-ignore | ||
/phpunit.xml export-ignore |
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,41 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 16 | ||
cache: npm | ||
- name: Install npm dependencies | ||
run: npm install | ||
- name: Cache Composer dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: /tmp/composer-cache | ||
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | ||
- name: Install composer dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
php_version: 7.3 | ||
version: 2 | ||
dev: yes | ||
quiet: yes | ||
args: --optimize-autoloader --classmap-authoritative --prefer-dist | ||
- name: Run Unit tests | ||
run: vendor/bin/phpunit tests | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: npm run release | ||
|
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,2 @@ | ||
node_modules | ||
vendor |
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,16 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create(); | ||
|
||
$config = new PhpCsFixer\Config(); | ||
return $config->setRules([ | ||
'@PSR12' => true, | ||
// 'strict_param' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'braces' => [ | ||
'allow_single_line_closure' => true, | ||
'position_after_functions_and_oop_constructs' => 'same' | ||
], | ||
]) | ||
->setFinder($finder) | ||
; |
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,24 @@ | ||
{ | ||
"branches": ["master", "next"], | ||
"plugins": [ | ||
["@semantic-release/changelog", { | ||
"changelogFile": "CHANGELOG.md" | ||
}], | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/exec", { | ||
"prepareCmd": "sh ./build/release.sh ${nextRelease.version}" | ||
}], | ||
["@semantic-release/git", { | ||
"assets": ["CHANGELOG.md", "composer.json"], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
}], | ||
["@semantic-release/github", { | ||
"assets": [{ | ||
"path": "build/release.zip", | ||
"name": "serbian-validators-${nextRelease.version}.zip", | ||
"label": "Version ${nextRelease.version}" | ||
}] | ||
}] | ||
] | ||
} |
Empty file.
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 @@ | ||
# Validates various serbian numbers | ||
|
||
Currently validates JMBG, PIB, and MB |
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,8 @@ | ||
#/bin/bash | ||
|
||
NEXT_VERSION=$1 | ||
CURRENT_VERSION=$(cat composer.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]') | ||
|
||
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEXT_VERSION\"/g" composer.json | ||
|
||
zip -r ./build/release.zip composer.json composer.lock src |
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,27 @@ | ||
{ | ||
"name": "oblak/serbian-validators", | ||
"description": "This Module Has useful functions for validating various serbian numbers", | ||
"authors": [ | ||
{ | ||
"name": "Sibin Grasic", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"license": "GPL-2.0-only", | ||
"version": "1.0.0", | ||
"type": "library", | ||
"require": { | ||
"php" : ">= 7.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9" | ||
}, | ||
"autoload": { | ||
"files": [ | ||
"src/utils.php", | ||
"src/validate-jmbg.php", | ||
"src/validate-pib.php", | ||
"src/validate-mb.php" | ||
] | ||
} | ||
} |
Oops, something went wrong.