Skip to content

Commit

Permalink
Update release builder (#1616)
Browse files Browse the repository at this point in the history
* Fix composer.json CS

* Update release builder

* Update release builder for UI

* Add missing "version" to composer for develop

* Prepare for release
  • Loading branch information
mvorisek authored Apr 16, 2021
1 parent af99293 commit 50bfcb6
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 169 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Drafter
name: Build Docs

on:
push:
Expand All @@ -9,7 +9,7 @@ jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: toolmantim/release-drafter@v5.6.1
- name: Run Release Drafter
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83 changes: 83 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build Release

on:
push:
branches:
- '**\.build/*'
- 'release/*'
- '!**\.gen'

jobs:
autocommit:
name: Build Release
runs-on: ubuntu-latest
container:
image: atk4/image:latest-npm
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Target variables - discover
id: target
run: |
echo "::set-output name=version_name::$(echo '${{ github.ref }}' | sed -E 's~.+/~~')"
- name: Target variables - show
run: |
echo "Target Version: ${{ steps.target.outputs.version_name }}"
if ! echo "${{ steps.target.outputs.version_name }}" | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+'; then echo "ERROR: Version must have [0-9].[0-9].[0-9] format!"; exit 1 ; fi
- name: Install PHP dependencies
run: composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader

- name: Composer unset version
run: composer config version --unset

- name: Update composer.json
run: >-
php -r '
$f = __DIR__ . "/composer.json";
$data = json_decode(file_get_contents($f), true);
foreach ($data as $k => $v) {
if (preg_match("~^(.+)-release$~", $k, $matches)) {
$data[$matches[1]] = $data[$k]; unset($data[$k]);
}
}
$str = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n";
echo $str;
file_put_contents($f, $str);
'
- name: Composer validate config
run: composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock

- name: Update version in src/App.php
run: |
sed -i "s|public \$version.*|public \$version = '${{ steps.target.outputs.version_name }}';|" src/App.php
- name: Install JS dependencies
run: |
npm install --loglevel=error -g pug-cli less less-plugin-clean-css uglify-js
(cd js && npm ci --loglevel=error)
- name: Compile JS and CSS files for CDN
run: |
(cd js && npm run build)
sed -i "s~'https://raw.githack.com/atk4/ui/develop/public.*~'/public',~" src/App.php
lessc public/agileui.less public/agileui.css --clean-css="--s1 --advanced" --source-map
echo '!/agileui.css.map' >> public/.gitignore
- name: Commit
run: |
git config --global user.name "$(git show -s --format='%an')"
git config --global user.email "$(git show -s --format='%ae')"
git add -A && git diff --staged && git commit -m "Build Release \"${{ steps.target.outputs.version_name }}\""
- name: Push
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}.gen
force: true
github_token: ${{ secrets.GITHUB_TOKEN }}
79 changes: 0 additions & 79 deletions .github/workflows/bundler.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['latest']
php: ['latest-npm']
type: ['Chrome', 'Firefox', 'Chrome Lowest', 'Chrome Slow']
env:
LOG_COVERAGE: ''
Expand Down Expand Up @@ -220,7 +220,6 @@ jobs:
- name: Install JS dependencies (only for Slow)
if: matrix.type == 'Chrome Slow'
run: |
apk add npm
npm install --loglevel=error -g pug-cli less less-plugin-clean-css uglify-js
(cd js && npm ci --loglevel=error)
Expand Down
172 changes: 87 additions & 85 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,95 @@
{
"name": "atk4/ui",
"type": "library",
"description": "Agile UI - Web Component Framework written in PHP",
"keywords": [
"framework",
"ui",
"web",
"form",
"component",
"widget",
"render",
"gadget",
"button",
"grid",
"crud"
],
"homepage": "https://github.com/atk4/ui",
"license": "MIT",
"authors": [
{
"name": "Romans Malinovskis",
"email": "[email protected]",
"homepage": "https://nearly.guru/"
"name": "atk4/ui",
"type": "library",
"description": "Agile UI - Web Component Framework written in PHP",
"keywords": [
"framework",
"ui",
"web",
"form",
"component",
"widget",
"render",
"gadget",
"button",
"grid",
"crud"
],
"homepage": "https://github.com/atk4/ui",
"version": "dev-develop",
"license": "MIT",
"authors": [
{
"name": "Romans Malinovskis",
"email": "[email protected]",
"homepage": "https://nearly.guru/"
},
{
"name": "Alain Belair",
"homepage": "https://agiletoolkit.org/"
},
{
"name": "Imants Horsts",
"homepage": "https://darkside.lv/"
},
{
"name": "Francesco Danti",
"homepage": "https://oracoltech.com/"
},
{
"name": "Michael Voříšek",
"homepage": "https://mvorisek.cz/"
},
{
"name": "Philipp Grashoff"
},
{
"name": "Alex Cicovic",
"homepage": "https://alexcicovic.com/"
},
{
"name": "Georgi Hristov",
"homepage": "https://xsystems.io/"
}
],
"require": {
"php": ">=7.3.0",
"atk4/data": "dev-develop"
},
{
"name": "Alain Belair",
"homepage": "https://agiletoolkit.org/"
"require-release": {
"php": ">=7.3.0",
"atk4/data": "~2.4.0"
},
{
"name": "Imants Horsts",
"homepage": "https://darkside.lv/"
"require-dev": {
"behat/behat": "^3.8",
"behat/mink": "^1.8",
"behat/mink-extension": "^2.3.1",
"behat/mink-selenium2-driver": "^1.4",
"ergebnis/composer-normalize": "^2.13",
"friendsofphp/php-cs-fixer": "^2.17",
"fzaninotto/faker": "^1.6",
"guzzlehttp/guzzle": "^6.3",
"instaclick/php-webdriver": "^1.4.7",
"johnkary/phpunit-speedtrap": "^3.2",
"phpstan/phpstan": "^0.12.82",
"phpunit/phpcov": "*",
"phpunit/phpunit": ">=9.3",
"symfony/process": "^4.4 || ^5.0"
},
{
"name": "Francesco Danti",
"homepage": "https://oracoltech.com/"
"config": {
"sort-packages": true
},
{
"name": "Michael Voříšek",
"homepage": "https://mvorisek.cz/"
"autoload": {
"psr-4": {
"Atk4\\Ui\\": "src/"
}
},
{
"name": "Philipp Grashoff"
"autoload-dev": {
"psr-4": {
"Atk4\\Ui\\Tests\\": "tests/",
"Atk4\\Ui\\Behat\\": "tests-behat/bootstrap/"
}
},
{
"name": "Alex Cicovic",
"homepage": "https://alexcicovic.com/"
},
{
"name": "Georgi Hristov",
"homepage": "https://xsystems.io/"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"require": {
"php": ">=7.3.0",
"atk4/data": "dev-develop"
},
"require-release": {
"php": ">=7.3.0",
"atk4/data": "~2.3.0"
},
"require-dev": {
"behat/behat": "^3.8",
"behat/mink": "^1.8",
"behat/mink-extension": "^2.3.1",
"behat/mink-selenium2-driver": "^1.4",
"friendsofphp/php-cs-fixer": "^2.17",
"fzaninotto/faker": "^1.6",
"guzzlehttp/guzzle": "^6.3",
"instaclick/php-webdriver": "^1.4.7",
"johnkary/phpunit-speedtrap": "^3.2",
"phpstan/phpstan": "^0.12.82",
"phpunit/phpcov": "*",
"phpunit/phpunit": ">=9.3",
"symfony/process": "^4.4 || ^5.0"
},
"autoload": {
"psr-4": {
"Atk4\\Ui\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Atk4\\Ui\\Tests\\": "tests/",
"Atk4\\Ui\\Behat\\": "tests-behat/bootstrap/"
}
}
"minimum-stability": "dev",
"prefer-stable": true
}

0 comments on commit 50bfcb6

Please sign in to comment.