@@ -3,28 +3,40 @@ name: Meta-package
33on :
44 workflow_call :
55 workflow_dispatch :
6+ pull_request :
7+ branches :
8+ - main
69
710jobs :
8- sync :
9- name : Sync
11+ package :
12+ name : Package
1013 runs-on : ubuntu-latest
1114 outputs :
12- tags-matrix : ${{ steps.tags-matrix .outputs.result }}
15+ package-name : ${{ steps.package .outputs.package-name }}
1316 steps :
1417 - uses : actions/checkout@v3
1518 with :
16- repository : ${{ secrets .META_PACKAGE }}
19+ repository : ${{ vars .META_PACKAGE }}
1720
1821 - name : Get upstream package name
1922 id : package
2023 run : echo "package-name=$(jq -r '.require | map_values(select(. == "self.version")) | keys[0]' composer.json)" >> $GITHUB_OUTPUT
2124
25+ sync :
26+ name : Sync
27+ runs-on : ubuntu-latest
28+ needs :
29+ - package
30+ outputs :
31+ tags-matrix : ${{ steps.tags-matrix.outputs.result }}
32+ steps :
33+ - uses : actions/checkout@v3
2234 - name : Generate matrix from versions arrays
2335 id : tags-matrix
2436 uses : actions/github-script@v6
2537 env :
26- PACKAGE : ${{ steps .package.outputs.package-name }}
27- META : ${{ secrets .META_PACKAGE }}
38+ PACKAGE : ${{ needs .package.outputs.package-name }}
39+ META : ${{ vars .META_PACKAGE }}
2840 with :
2941 script : |
3042 const tags = require('${{ github.workspace }}/.github/scripts/tags.js')
3648 needs :
3749 - sync
3850 if : needs.sync.outputs.tags-matrix != '[]'
51+ continue-on-error : true
3952 strategy :
4053 fail-fast : false
4154 matrix :
5063
5164 - uses : actions/checkout@v3
5265 with :
53- repository : ${{ secrets .META_PACKAGE }}
66+ repository : ${{ vars .META_PACKAGE }}
5467 token : ${{ steps.generate-token.outputs.token }}
5568
56- - name : Retrieve version notes
57- id : notes
58- uses : actions/github-script@v6
59- env :
60- VERSION : ${{ matrix.tag }}
61- with :
62- result-encoding : string
63- script : |
64- const notes = require('${{ github.workspace }}/.github/scripts/notes.js')
65- return await notes({ core, fetch })
66-
6769 - name : Push tag
6870 env :
6971 TAG : ${{ matrix.tag }}
@@ -73,11 +75,29 @@ jobs:
7375 git tag -a "${TAG}" -m "${TAG}"
7476 git push origin "${TAG}"
7577
76- - name : Publish release
77- uses : softprops/action-gh-release@v1
78+ releases :
79+ name : Releases
80+ runs-on : ubuntu-latest
81+ needs :
82+ - sync
83+ - tags
84+ steps :
85+ - name : Generate token
86+ uses : tibdex/github-app-token@v1
87+ id : generate-token
7888 with :
79- repository : ${{ secrets.META_PACKAGE }}
80- token : ${{ steps.generate-token.outputs.token }}
81- body : ${{ steps.notes.outputs.result }}
82- name : Version ${{ matrix.tag }}
83- tag_name : ${{ matrix.tag }}
89+ app_id : ${{ secrets.BOT_APP_ID }}
90+ private_key : ${{ secrets.BOT_PRIVATE_KEY }}
91+
92+ - uses : actions/checkout@v3
93+
94+ - name : Retrieve version notes
95+ uses : actions/github-script@v6
96+ env :
97+ TAGS_MATRIX : ${{ needs.sync.outputs.tags-matrix }}
98+ META_PACKAGE : ${{ vars.META_PACKAGE }}
99+ with :
100+ github-token : ${{ steps.generate-token.outputs.token }}
101+ script : |
102+ const notes = require('${{ github.workspace }}/.github/scripts/notes.js')
103+ await notes({ github, core, fetch })
0 commit comments