Skip to content

Commit

Permalink
refactor workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
SushilMallRC committed May 1, 2024
1 parent 556292f commit bf802e2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release-with-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [8.1, 8.0, 7.4]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2
ini-values: phar.readonly=0
- name: Composer update
run: composer update
- name: Install dependencies
run: composer install --prefer-dist --no-interaction
- name: Run tests
run: composer test
- name: Build phar
run: composer phar
- name: Release
if: matrix.php-version == '7.4' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ./dist/ringcentral.phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 2 additions & 13 deletions .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: CI Pipeline

name: Test
on: [push, pull_request]

## Github Actions for PHP SDK

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -36,11 +32,4 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=dist/coverage/clover.xml -v
- name: Release
if: matrix.php-version == '7.4' && startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: ./dist/ringcentral.phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
php-coveralls --coverage_clover=dist/coverage/clover.xml -v

0 comments on commit bf802e2

Please sign in to comment.