Prepare 1.5.0 release #99
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- prepare-release | |
workflow_dispatch: | |
jobs: | |
matrix: | |
name: Find layers | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'bref-bot' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Only find layers that have changed since last tag | |
- id: find-layers | |
run: | | |
git fetch --prune --unshallow | |
echo "::set-output name=list::$(git diff --name-only HEAD $(git describe --tags --abbrev=0) | grep layers/ | cut -d / -f 2 | sort | uniq | jq -R -s -c 'split("\n")[:-1]')" | |
# If the workflow was triggered manually, then build all layers | |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "::set-output name=list::$(ls layers | jq -R -s -c 'split("\n")[:-1]')"; fi | |
outputs: | |
# Make the outputs accessible outside this job | |
list: ${{ steps.find-layers.outputs.list }} | |
build: | |
needs: matrix | |
name: Build & publish layer | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'bref-bot' }} | |
env: | |
DOCKER_BUILDKIT: '1' | |
strategy: | |
fail-fast: false | |
matrix: | |
layer: ${{ fromJson(needs.matrix.outputs.list) }} | |
steps: | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.4 | |
coverage: none | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download dependencies | |
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable | |
- name: Clean export directory | |
run: make clean | |
- name: Build layers | |
run: layer=${{ matrix.layer }} make layers | |
- name: Publish layers | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} | |
run: php ./bref-extra publish | |
list: | |
needs: build | |
name: Update layer versions | |
runs-on: ubuntu-latest | |
if: ${{ github.actor != 'bref-bot' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download dependencies | |
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable | |
- name: List layers | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }} | |
run: php ./bref-extra list | |
- name: Commit changes | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Bref Bot" | |
git add layers.json | |
git commit -m "Updated layers.json" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
branch: prepare-release | |