Skip to content

Allow to use target aggregate id header for async scenarios (#323) #110

Allow to use target aggregate id header for async scenarios (#323)

Allow to use target aggregate id header for async scenarios (#323) #110

Workflow file for this run

name: 'Releasing latest changes'
on:
push:
tags:
- '*'
env:
# 1. for Github split
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
jobs:
prepare-code-for-release:
name: "Auto fix PHP CS and set up required package versions"
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
- name: We need to fetch all related branches to perform next action
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Checkout branch related to tag
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "checking out branch $branch for tag ${GITHUB_REF#refs/tags/}"
git checkout $branch
- name: Install PHP-CS-Fixer
run: |
composer global require friendsofphp/php-cs-fixer
export PATH="$PATH:$HOME/.composer/vendor/bin"
- name: Run PHP CS Fixer
run: php-cs-fixer fix --config=.php-cs-fixer.dist.php --allow-risky=yes
- name: Run Update Required Packages
run: php bin/update-required-packages.php ${{ github.ref_name }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Release ${{ github.ref_name }}
get_packages:
name: Package splitting
needs: prepare-code-for-release
runs-on: ubuntu-latest
steps:
- name: Set Up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
- uses: actions/checkout@v2
- name: Get Packages
id: get_json
run: echo "::set-output name=json::$(bin/get-packages)"
- name: Output Packages
run: echo "${{ steps.get_json.outputs.json }}"
outputs:
matrix: ${{ steps.get_json.outputs.json }}
split_packages:
name: Split Package ${{ matrix.package.name }}
needs: get_packages
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.get_packages.outputs.matrix) }}
steps:
# We need to check out what we've committed in prepare-code-for-release
- name: We need to fetch all related branches to perform next action
uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Checkout branch related to tag
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "checking out branch $branch for tag ${GITHUB_REF#refs/tags/}"
git checkout $branch
-
uses: "danharrin/monorepo-split-github-action@v2.3.0"
if: "startsWith(github.ref, 'refs/tags/')"
with:
tag: ${GITHUB_REF#refs/tags/}
# ↓ split "packages/easy-coding-standard" directory
package_directory: '${{ matrix.package.directory }}'
# ↓ into https://github.com/symplify/easy-coding-standard repository
repository_organization: '${{ matrix.package.organisation }}'
repository_name: '${{ matrix.package.repository }}'
# ↓ the user signed under the split commit
user_name: "Dariusz Gafka"
user_email: "dgafka.mail@gmail.com"
tweet:
runs-on: ubuntu-latest
needs: split_packages
steps:
- uses: Eomm/why-don-t-you-tweet@v1
with:
tweet-message: New Ecotone version was released ${{ github.ref_name }}. Check the changelog on https://github.com/ecotoneframework/ecotone-dev/releases/tag/${{ github.ref_name }}
env:
# Get your tokens from https://developer.twitter.com/apps
TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}