Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 19 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,39 @@ name: Release
jobs:
build:
name: Create Release
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Set RELEASE_VERSION
run: echo RELEASE_VERSION=$(echo ${GITHUB_REF:10}) >> $GITHUB_ENV

- name: Checkout code
uses: actions/checkout@v1

- name: Setup PHP
uses: nanasess/setup-php@v3
uses: shivammathur/setup-php@v2
with:
## box.phar requires php72
php-version: '7.4'
tools: composer:v2
extensions: pcntl

- name: Set env
run: |
echo RELEASE_VERSION=${GITHUB_REF:10} >> $GITHUB_ENV

- name: Checkout code
uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate

- name: Build PHAR
run: ./scripts/build.sh
run: ./scripts/build.sh && mv dist/git-scan.phar dist/git-scan-${{ env.RELEASE_VERSION }}.phar
continue-on-error: false

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
body: |
Changes in this Release
- First Change
- Second Change
draft: true
prerelease: false

- name: Upload PHAR
id: upload_release
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./bin/git-scan.phar
asset_name: git-scan-${{ env.RELEASE_VERSION }}.phar
asset_content_type: application/octet-stream
files: dist/git-scan-*.phar
37 changes: 23 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,31 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-18.04 ]
php: [ '7.2', '7.4', '8.0', '8.1' ]
include:
- operating-system: windows-2019
php: '7.2'
#operating-system: [ ubuntu-18.04, windows-2019 ]
#php: [ '7.2', '7.4', '8.0' ]
- operating-system: ubuntu-latest
php: 7.3
phpunit: 8
- operating-system: ubuntu-latest
php: 7.4
phpunit: 8
- operating-system: ubuntu-latest
php: 8.1
phpunit: 9
- operating-system: ubuntu-latest
php: 8.3
phpunit: 9
## We used to test here, but we were forced to switch to newer actions.
## But these actions don't seem to run on Windows...
#- operating-system: windows-2019
# php: '7.3'
# phpunit: 8
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v3
- name: Setup PHP
uses: nanasess/setup-php@v3
- uses: php-actions/composer@v6
- name: PHPUnit Tests
uses: php-actions/phpunit@v3
with:
php-version: ${{ matrix.php }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Set example Git user
run: git config --global user.email "testbot@example.com" && git config --global user.name "Test Bot"
- run: ./scripts/test.sh
configuration: phpunit.xml.dist
version: ${{ matrix.phpunit }}
php_version: ${{ matrix.php }}
2 changes: 1 addition & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
],
"git-version": "package_version",
"main": "bin/git-scan",
"output": "bin/git-scan.phar",
"output": "dist/git-scan.phar",
"stub": true
}
22 changes: 19 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
}
],
"require": {
"php": ">=7.2",
"php": ">=7.3.0",
"symfony/console": "^4.4",
"symfony/process": "^4.4",
"symfony/filesystem": "^4.4",
"symfony/finder": "^4.4"
"symfony/finder": "^4.4",
"civicrm/composer-downloads-plugin": "~3.0"
},
"autoload": {
"psr-0": {
Expand All @@ -24,6 +25,21 @@
"bin/git-scan"
],
"config": {
"bin-dir": "bin"
"platform": {
"php": "7.3.0"
},
"bin-dir": "bin",
"allow-plugins": {
"civicrm/composer-downloads-plugin": true
}
},
"extra": {
"downloads": {
"box": {
"url": "https://github.com/humbug/box/releases/download/3.16.0/box.phar",
"path": "extern/box",
"type": "phar"
}
}
}
}
Loading