From a7a4b03c3270d33ca855cfed8de0583ef2a9a92e Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 26 Apr 2020 17:16:38 +0300 Subject: [PATCH] Use working version of create-release action See: actions/create-release#2 --- .ci/build-phar.sh | 4 +- .github/workflows/analysis.yml | 3 ++ .github/workflows/build-linux.yml | 43 ++++++++-------- .github/workflows/build-windows.yml | 12 ++++- .github/workflows/release.yml | 76 ++++++++++++----------------- 5 files changed, 71 insertions(+), 67 deletions(-) diff --git a/.ci/build-phar.sh b/.ci/build-phar.sh index dc5b59b3cc..0ed8c94995 100755 --- a/.ci/build-phar.sh +++ b/.ci/build-phar.sh @@ -18,8 +18,8 @@ if [ "$(command -v box 2>/dev/null || true)" = "" ]; then exit 1 fi -box validate -box compile +box validate || exit 1 +box compile || exit 1 if [ ! -f "./zephir.phar" ] || [ ! -x "./zephir.phar" ]; then (>&2 echo "Something went wrong when building zephir.phar") diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 374f0ca5bf..cc8e3efd8c 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -2,12 +2,15 @@ name: Static Code Analysis on: push: + branches: + - development paths-ignore: - '**.md' - '**.txt' pull_request: branches: - master + - develoment jobs: analysis: diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 4a42aa9554..ce43c0e493 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -2,6 +2,8 @@ name: Linux CI on: push: + branches: + - development paths-ignore: - '**.md' - '**.txt' @@ -74,16 +76,16 @@ jobs: date.timezone=UTC, xdebug.max_nesting_level=256 - - name: Set environment variables + - name: Set Environment Variables run: | echo "::set-env name=SYMFONY_PHPUNIT_VERSION::${{ matrix.symfony_phpunit }}" - - name: Checkout code + - name: Checkout Code uses: actions/checkout@v2 with: fetch-depth: 5 - - name: Common settings + - name: Common Settings run: | # Core dump settings ulimit -c unlimited -S || true @@ -94,7 +96,7 @@ jobs: # Will be used before as a cache key export CPUHASH="$(cat /proc/cpuinfo | grep "model name" | head -n 1 | cut -d':' -f2 | md5sum)" - - name: Setup APT repositories + - name: Setup APT Repositories run: | # We don't need this at all, and our # builds often fails because Microsoft @@ -102,7 +104,7 @@ jobs: sudo rm -f /etc/apt/sources.list.d/dotnetdev.list sudo rm -f /etc/apt/sources.list.d/azure*.list - - name: Install system dependencies + - name: Install System Dependencies run: | sudo apt-get update --quiet --yes 1>/dev/null sudo apt-get install --no-install-recommends -q -y re2c @@ -121,13 +123,6 @@ jobs: - name: Install Zephir Parser run: .ci/install-zephir-parser.sh ${{ matrix.php }} - - name: Setup GitHub Token - run: | - # To increase the GitHub rate limit we're use GitHub authentication - if [ -n "${{ secrets.GH_TOKEN }}" ]; then - composer config github-oauth.github.com "${{ secrets.GH_TOKEN }}" - fi - - name: Get Composer Cache Directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" @@ -137,12 +132,22 @@ jobs: with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + restore-keys: + ${{ runner.os }}-composer-${{ env.cache-name }}- + ${{ runner.os }}-composer- + ${{ runner.os }}- + + - name: Setup Composer Token + run: | + # To increase the GitHub rate limit we're use GitHub authentication + if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then + composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}" + fi - - name: Install project dependencies + - name: Install Project Dependencies run: composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest - - name: Prepare Zephir executable + - name: Prepare Zephir Executable run: sudo ln -s "$(pwd)/zephir" /usr/local/bin/zephir - name: Fast Commands Test @@ -167,10 +172,10 @@ jobs: - name: Setup Problem Matchers for PHPUnit run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Unit testing + - name: Unit Testing run: .ci/run-tests.sh - - name: Black-box testing + - name: Black-box Testing if: always() run: cd unit-tests/sharness && PHP=$(which php) make @@ -178,7 +183,7 @@ jobs: if: failure() run: .ci/after-failure.sh - - name: Upload code coverage report + - name: Upload Code Coverage Report uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -187,6 +192,6 @@ jobs: flags: unittests fail_ci_if_error: false - - name: Success reporting + - name: Success Reporting if: success() run: git log --format=fuller -5 diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index cefc7f3423..585846f7f5 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -2,12 +2,15 @@ name: Windows CI on: push: + branches: + - development paths-ignore: - '**.md' - '**.txt' pull_request: branches: - master + - development env: PARSER_VERSION: 1.3.4 @@ -60,7 +63,7 @@ jobs: env: PHPTS: ${{ matrix.build_type }} - - name: Set Up Environment Variables + - name: Set Environment Variables run: | echo "::set-env name=SYMFONY_PHPUNIT_VERSION::${{ matrix.symfony_phpunit }}" echo "::set-env name=PHP_VERSION::$(php -r 'echo phpversion();')" @@ -143,6 +146,13 @@ jobs: ${{ runner.os }}-composer- ${{ runner.os }}- + - name: Setup GitHub Token + run: | + # To increase the GitHub rate limit we're use GitHub authentication + if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then + composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}" + fi + - name: Install Project Dependencies run: composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9245bfd126..9a8ee4eafb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,51 +10,49 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set environment variables + - name: Setup Environment Variables uses: allenevans/set-env@v1.0.0 with: BOX_VERSION: '3.8.4' - - name: Checkout code - uses: actions/checkout@v2-beta + - name: Checkout Code + uses: actions/checkout@v2 with: fetch-depth: 5 - name: Setup PHP - uses: shivammathur/setup-php@v1 + uses: shivammathur/setup-php@v2 with: php-version: '7.2' extensions: intl, zip, zlib coverage: none ini-values: memory_limit=1G, phar.readonly=0 - - name: Common settings - run: | - git config --global user.name cicdbot - git config --global user.email team@zephir-lang.com - - # Choose a suitable PHP version to build PHAR - composer config platform.php 7.0.33 - - - name: Setup GitHub Token - run: | - # To increase the GitHub rate limit we're use GitHub authentication - if [ -n "${{ secrets.GH_TOKEN }}" ]; then - composer config github-oauth.github.com "${{ secrets.GH_TOKEN }}" - fi + - name: Choose a Suitable PHP Version to Build PHAR + run: composer config platform.php 7.0.33 - name: Get Composer Cache Directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Cache dependencies + - name: Setup Composer Cache uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + restore-keys: + ${{ runner.os }}-composer-${{ env.cache-name }}- + ${{ runner.os }}-composer- + ${{ runner.os }}- - - name: Install project dependencies + - name: Setup GitHub Token + run: | + # To increase the GitHub rate limit we're use GitHub authentication + if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then + composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}" + fi + + - name: Install Project Dependencies run: composer install --prefer-dist --no-interaction --no-ansi --no-progress --no-suggest - name: Install Box @@ -68,34 +66,22 @@ jobs: sudo mv ./box /usr/local/bin - name: Build Zephir PHAR - run: | - .ci/build-phar.sh - ls -al ./zephir.phar - cat ".git/${{ github.ref }}" + run: .ci/build-phar.sh - - name: Get the version + - name: Geting Tag Name id: get-version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} - name: Create Release - id: create_release - uses: actions/create-release@v1.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ncipollo/release-action@v1 with: - tag_name: ${{ github.ref }} - release_name: ${{ steps.get-version.outputs.VERSION }} + # This token is provided by GitHub Actions. + # You DO NOT need to create your own token. + token: ${{ secrets.GITHUB_TOKEN }} + name: ${{ steps.get-version.outputs.version }} + tag: ${{ steps.get-version.outputs.version }} body: 'All notable changes to this version has been documented in the CHANGELOG.md file.' - draft: false - prerelease: false - - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./zephir.phar - asset_name: zephir.phar - asset_content_type: application/x-php + # This will update existing tags if any + allowUpdates: true + artifacts: zephir.phar + artifactContentType: application/x-php