-
-
Notifications
You must be signed in to change notification settings - Fork 978
86 lines (75 loc) · 2.74 KB
/
Copy pathrelease.yml
File metadata and controls
86 lines (75 loc) · 2.74 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
82
83
84
85
86
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
permissions:
contents: read
jobs:
split:
name: Subtree Split
runs-on: ubuntu-latest
steps:
- name: Generate App Token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{ secrets.API_PLATFORM_APP_ID }}
private_key: ${{ secrets.API_PLATFORM_APP_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
- name: Install splitsh
env:
SPLITSH_VERSION: v1.0.1
SPLITSH_SHA256: 2539301ce5e21d0ca44b689d0dd2c1b20d9f9e996c1fe6c462afb8af4e7141cc
run: |
curl -fsSL "https://github.com/splitsh/lite/releases/download/$SPLITSH_VERSION/lite_linux_amd64.tar.gz" > lite_linux_amd64.tar.gz
echo "$SPLITSH_SHA256 lite_linux_amd64.tar.gz" | sha256sum --check --strict
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 tools/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@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
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@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
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