Skip to content

Daily build

Daily build #183

Workflow file for this run

################################################################################
# The setups in this file belong to the project https://code.shin.company/php
# I appreciate you respecting my intellectual efforts in creating them.
# If you intend to copy or use ideas from this project, please credit properly.
# Author: SHIN Company <[email protected]>
# License: https://code.shin.company/php/blob/main/LICENSE
################################################################################
name: Daily build
################################################################################
################################################################################
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
release:
types: [released]
pull_request:
types: [opened]
paths:
- 'src/**'
- '!src/**.md'
################################################################################
################################################################################
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
tag_prefix: ${{ steps.init.outputs.tag_prefix }}
build_all: ${{ steps.init.outputs.build_all == '1' }}
steps:
- name: pre-build debug
id: init
run: |
the_day=$(date -u +"%d")
event_name=${{ github.event_name }}
ref_type=${{ github.ref_type }}
ref=${{ github.ref }}
tag_prefix=$(if [[ $ref_type != 'tag' ]] && [[ $ref != 'refs/heads/main' ]]; then echo 'dev-'; fi)
build_all=$(if [[ $event_name != 'schedule' ]] || [[ $the_day == '01' ]]; then echo '1'; fi)
# For debugging purposes
echo "the_day=$the_day" >> "$GITHUB_OUTPUT"
echo "tag_prefix=$tag_prefix" >> "$GITHUB_OUTPUT"
echo "build_all=$build_all" >> "$GITHUB_OUTPUT"
echo "github.event_name = $event_name"
echo "github.ref_type = $ref_type"
echo "github.ref = $ref"
echo "tag_prefix = $tag_prefix"
echo "build_all = $(if [ ! -z "$build_all" ]; then echo 'yes, includes outdated versions'; else echo 'no, only maintained versions'; fi)"
s6:
uses: ./.github/workflows/00-s6-overlay.yml
secrets: inherit
needs: [prepare]
with:
tag_prefix: ${{ needs.prepare.outputs.tag_prefix }}
php:
uses: ./.github/workflows/01-php.yml
secrets: inherit
needs: [prepare]
with:
tag_prefix: ${{ needs.prepare.outputs.tag_prefix }}
build_all: ${{ fromJSON(needs.prepare.outputs.build_all) || false }}
php-servers:
uses: ./.github/workflows/02-servers.yml
secrets: inherit
needs: [prepare, php]
with:
tag_prefix: ${{ needs.prepare.outputs.tag_prefix }}
build_all: ${{ fromJSON(needs.prepare.outputs.build_all) || false }}
php-apps:
uses: ./.github/workflows/03-apps.yml
secrets: inherit
needs: [prepare, php-servers]
with:
tag_prefix: ${{ needs.prepare.outputs.tag_prefix }}
build_all: ${{ fromJSON(needs.prepare.outputs.build_all) || false }}
################################################################################
################################################################################