Skip to content

Commit

Permalink
Use working version of create-release action
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Apr 26, 2020
1 parent 52322ff commit a7a4b03
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .ci/build-phar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ name: Static Code Analysis

on:
push:
branches:
- development
paths-ignore:
- '**.md'
- '**.txt'
pull_request:
branches:
- master
- develoment

jobs:
analysis:
Expand Down
43 changes: 24 additions & 19 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Linux CI

on:
push:
branches:
- development
paths-ignore:
- '**.md'
- '**.txt'
Expand Down Expand Up @@ -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
Expand All @@ -94,15 +96,15 @@ 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
# servers are unstable or even offline.
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
Expand All @@ -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)"
Expand All @@ -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
Expand All @@ -167,18 +172,18 @@ 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

- name: After Failure
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 }}
Expand All @@ -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
12 changes: 11 additions & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();')"
Expand Down Expand Up @@ -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

Expand Down
76 changes: 31 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit a7a4b03

Please sign in to comment.