1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 02:47:02 +01:00
psalm/.github/workflows/build-phar.yml

81 lines
2.4 KiB
YAML
Raw Normal View History

name: Build phar
on:
2021-02-11 19:52:10 +01:00
push:
branches:
- master
release:
types:
- published
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v3.4.0
with:
concurrent_skipping: always
cancel_others: true
do_not_skip: '["release"]'
# list files that may affect or are included into the built phar
paths: '["bin/**", "assets/**", "build/**", "dictionaries/**", "src/**", "stubs/**", "psalm", "psalm-language-server", "psalm-plugin", "psalm-refactor", "psalter", "box.json.dist", "composer.json", "config.xsd", "keys.asc.gpg", "scoper.inc.php"]'
build-phar:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
coverage: none
- uses: actions/checkout@v2
- name: Get Composer Cache Directories
id: composer-cache
run: |
echo "::set-output name=files_cache::$(composer config cache-files-dir)"
echo "::set-output name=vcs_cache::$(composer config cache-vcs-dir)"
- name: Cache composer cache
uses: actions/cache@v2
with:
path: |
${{ steps.composer-cache.outputs.files_cache }}
${{ steps.composer-cache.outputs.vcs_cache }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Run composer install
run: composer install -o
env:
COMPOSER_ROOT_VERSION: dev-master
- run: bin/build-phar.sh
env:
2021-01-11 20:37:17 +01:00
GPG_SIGNING: 1
2021-01-11 21:15:14 +01:00
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Upload release assets
2021-02-11 19:52:10 +01:00
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/psalm.phar*
file_glob: true
tag: ${{ github.ref }}
2021-02-11 19:46:45 +01:00
- name: Release psalm/phar
2021-02-11 19:47:19 +01:00
run: bin/github-deploy-phar.sh
2021-02-11 19:59:52 +01:00
env:
PHAR_REPO_TOKEN: ${{ secrets.PHAR_REPO_TOKEN }}