|
1 |
| ---- |
2 |
| -name: Release published |
| 1 | +name: Release Action |
3 | 2 |
|
4 | 3 | on:
|
5 | 4 | release:
|
6 |
| - types: [ published, edited ] |
| 5 | + types: |
| 6 | + - published |
7 | 7 |
|
8 |
| -permissions: |
9 |
| - actions: write |
10 |
| - checks: write |
11 |
| - contents: read |
12 |
| - deployments: read |
13 |
| - issues: write |
14 |
| - discussions: write |
15 |
| - packages: read |
16 |
| - pages: write |
17 |
| - pull-requests: write |
18 |
| - security-events: write |
19 |
| - statuses: write |
| 8 | +env: |
| 9 | + GH_TOKEN: ${{ secrets.GH_TOKEN_COMMIT }} |
20 | 10 |
|
21 | 11 | jobs:
|
22 |
| - build: |
| 12 | + notify-release: |
23 | 13 | runs-on: ubuntu-latest
|
| 14 | + name: Notify Release |
24 | 15 | strategy:
|
25 | 16 | matrix:
|
26 |
| - php: [ '8.1', '8.2', '8.3', '8.4' ] |
27 |
| - |
28 |
| - name: PHP ${{ matrix.php }} Test |
29 |
| - |
| 17 | + url: [SLACK_WEBHOOK_ASK_DEVREL_URL, SLACK_WEBHOOK_DEVREL_TOOLING_URL, SLACK_WEBHOOK_DEVREL_PRIVATE_URL, SLACK_WEBHOOK_COMMUNITY] |
30 | 18 | steps:
|
31 |
| - - name: Checkout |
32 |
| - uses: actions/checkout@v2 |
33 |
| - |
34 |
| - - name: Setup PHP |
35 |
| - uses: shivammathur/setup-php@v2 |
| 19 | + - name: Send to slack channles |
| 20 | + |
36 | 21 | with:
|
37 |
| - php-version: ${{ matrix.php }} |
38 |
| - extensions: json, mbstring |
39 |
| - coverage: pcov |
40 |
| - env: |
41 |
| - COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
42 |
| - |
43 |
| - - name: Setup problem matchers for PHPUnit |
44 |
| - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
45 |
| - |
46 |
| - - name: Get Composer cache directory |
47 |
| - id: composercache |
48 |
| - run: echo "::set-output name=dir::$(composer config cache-files-dir)" |
49 |
| - |
50 |
| - - name: Cache Composer dependencies |
51 |
| - uses: actions/cache@v2 |
52 |
| - with: |
53 |
| - path: ${{ steps.composercache.outputs.dir }} |
54 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
55 |
| - restore-keys: ${{ runner.os }}-composer- |
56 |
| - |
57 |
| - - name: Install dependencies |
58 |
| - run: composer update --prefer-dist --no-interaction |
59 |
| - |
60 |
| - - name: Analyze & test |
61 |
| - run: composer test -- -v --coverage-clover=coverage.xml |
62 |
| - |
63 |
| - - name: Run PHPStan |
64 |
| - run: ./vendor/bin/phpstan |
65 |
| - |
66 |
| - - name: Run codecov |
67 |
| - uses: codecov/codecov-action@v1 |
| 22 | + webhook: ${{ secrets[matrix.url]}} |
| 23 | + webhook-type: incoming-webhook |
| 24 | + errors: true |
| 25 | + payload: | |
| 26 | + blocks: |
| 27 | + - type: "header" |
| 28 | + text: |
| 29 | + type: "plain_text" |
| 30 | + text: ":initial_external_notification_sent: :php: Version ${{ github.event.release.name }} of the PHP SDK has been released" |
| 31 | + - type: "section" |
| 32 | + text: |
| 33 | + type: "mrkdwn" |
| 34 | + text: "${{ github.event.release.body }}" |
| 35 | + - type: "divider" |
| 36 | + - type: "section" |
| 37 | + text: |
| 38 | + type: "mrkdwn" |
| 39 | + text: "You can view the full change log <${{github.event.release.html_url }}|here>" |
0 commit comments