Skip to content

Trigger release

Trigger release #21

Workflow file for this run

name: Trigger release
on:
workflow_run:
workflows: [CI]
types: [completed]
branches: [master]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository == 'flathub-infra/flatpak-builder-lint' && github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
with:
ref: 'master'
- name: Check last commit message
run: |
if git log -1 --pretty=%B|xargs|grep -E "\[release\]"; then
echo "IS_RELEASE=true" >> "$GITHUB_ENV"
fi
- name: Check if docker-manifest succeeded
if: env.IS_RELEASE == 'true'
run: |
job_status=$(gh run view ${{ github.event.workflow_run.id }} --json jobs --jq '.jobs[] | select(.name=="docker-call / docker-manifest") | .conclusion')
echo "Status: $job_status"
if [ "$job_status" == "success" ]; then
echo "RUN=true" >> "$GITHUB_ENV"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delay for 2 minutes
if: env.RUN == 'true'
run: sleep 120
- name: Trigger workflow in org.flatpak.Builder repository
if: env.RUN == 'true'
uses: peter-evans/repository-dispatch@v3
with:
repository: flathub/org.flatpak.Builder
event-type: trigger-workflow
client-payload: '{"sha": "${{ github.sha }}"}'
token: ${{ secrets.LINTER_TRIGGER_WORKFLOW_TOKEN }}
- name: Trigger workflow in flathub-infra/flatpak-github-actions
if: env.RUN == 'true'
uses: peter-evans/repository-dispatch@v3
with:
repository: flathub-infra/flatpak-github-actions
event-type: trigger-workflow
token: ${{ secrets.LINTER_TRIGGER_WORKFLOW_TOKEN }}