diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..c82a456e --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,60 @@ +on: + push: + tags: + - '*' + +name: CD + +jobs: + release: + if: ${{ startsWith(github.ref_name, '5.') }} + runs-on: ubuntu-latest + + env: + PHP_EXTENSIONS: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter + + steps: + - name: checkout code + uses: actions/checkout@v3 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: ${{ env.PHP_EXTENSIONS }} + + - name: Install dependencies + uses: php-actions/composer@v6 + + - name: Run make + run: make + + - name: create release assets + run: | + mkdir release + git archive release + cd release + make + cd .. + tar -cvzf release.tar.gz release + + - name: create release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref }} + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: upload artifacts + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./release.tar.gz + asset_name: release.tar.gz + asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7752c3f..826c53f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Override PHP ini values for JIT compiler if: matrix.compiler == 'jit' @@ -62,21 +62,18 @@ jobs: extensions: ${{ env.PHP_EXTENSIONS }} ini-values: ${{ env.PHP_INI_VALUES }} - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install - - name: Cache Composer packages id: composer-cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: vendor key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} restore-keys: | ${{ runner.os }}-php-${{ matrix.php-version }}- + - name: Install dependencies + uses: php-actions/composer@v6 + - name: Run make run: make diff --git a/TODO.txt b/TODO.txt index 17850a95..4b15ef6c 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,6 +5,9 @@ - review ->(step|total|first|last|do_else|key|show|iteration|index) - review ->tpl_vars, ->config_vars, ->value +## Build +- add compiled lexers and parsers to Release assets automatically + ## Block / inheritance - Consider phasing out $smarty.block.child as this reverses the inheritance hierarchy and might cause infinite loops when combined with $smarty.block.parent diff --git a/composer.json b/composer.json index 6ace02b6..b6b962bd 100644 --- a/composer.json +++ b/composer.json @@ -48,6 +48,12 @@ }, "require-dev": { "phpunit/phpunit": "^8.5 || ^7.5", - "smarty/smarty-lexer": "^4.0" + "smarty/smarty-lexer": "dev-master" + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/smarty-php/smarty-lexer" } +] }