-
-
Notifications
You must be signed in to change notification settings - Fork 963
81 lines (71 loc) · 2.33 KB
/
release.yml
File metadata and controls
81 lines (71 loc) · 2.33 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release Pipeline
on:
push:
tags:
- 'v*'
branches:
- main
- '[0-9].*'
- '[0-9][0-9].*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
split:
name: Subtree Split
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Generate App Token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v6
with:
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
- name: Install splitsh
run: |
curl -L https://github.com/splitsh/lite/releases/download/v1.0.1/lite_linux_amd64.tar.gz > lite_linux_amd64.tar.gz
tar -zxpf lite_linux_amd64.tar.gz
chmod +x splitsh-lite
echo "$(pwd)" >> $GITHUB_PATH
- name: Split to manyrepo
run: find src -maxdepth 3 -name composer.json -print0 | xargs -I '{}' -n 1 -0 bash subtree.sh {} ${{ github.ref }}
dispatch-distribution-update:
name: Dispatch Distribution Update
runs-on: ubuntu-latest
needs: split
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Generate App Token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
- name: Update distribution
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: gh workflow run -R api-platform/api-platform release.yml -f tag=${{ github.ref_name }}
dispatch-demo-update:
name: Dispatch Demo Update
runs-on: ubuntu-latest
needs: split
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Generate App Token
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
- name: Update demo
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
run: gh workflow run -R api-platform/demo upgrade-api-platform.yml