-
Notifications
You must be signed in to change notification settings - Fork 138
57 lines (48 loc) · 1.82 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 }}