|
1 | 1 | name: Publish daemons |
2 | | -# portions from gemini pro |
| 2 | +# portions from gemini pro and fast |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | schedule: |
|
26 | 26 |
|
27 | 27 |
|
28 | 28 | jobs: |
| 29 | + setup-matrix: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + outputs: |
| 32 | + matrix: ${{ steps.set-matrix.outputs.matrix }} |
| 33 | + has_jobs: ${{ steps.set-matrix.outputs.has_jobs }} |
| 34 | + steps: |
| 35 | + - id: set-matrix |
| 36 | + uses: actions/github-script@v7 |
| 37 | + env: |
| 38 | + REF_NAME: ${{ github.ref_name }} |
| 39 | + with: |
| 40 | + script: | |
| 41 | + const allContainers = [ |
| 42 | + 'apphandler', |
| 43 | + 'authhandler', |
| 44 | + 'avsdispatcher', |
| 45 | + 'housekeeping', |
| 46 | + 'ltihandler', |
| 47 | + 'notepadhandler', |
| 48 | + 'noteshandler', |
| 49 | + 'staticserver' |
| 50 | + ] |
| 51 | + const allContainersWithContext = allContainers.map((container) => ({ |
| 52 | + container, |
| 53 | + context: './daemons/' + container |
| 54 | + })) |
| 55 | + |
| 56 | + const isTag = context.ref.startsWith('refs/tags/'); |
| 57 | + const refName = process.env.REF_NAME; |
| 58 | + |
| 59 | + let activeContainers = allContainersWithContext; |
| 60 | + if (isTag) { |
| 61 | + activeContainers = allContainersWithContext.filter(c => refName.includes(c.container)); |
| 62 | + } |
| 63 | + |
| 64 | + core.setOutput('has_jobs', activeContainers.length > 0); |
| 65 | + core.setOutput('matrix', JSON.stringify({ include: activeContainers })); |
| 66 | +
|
29 | 67 | build: |
| 68 | + needs: setup-matrix |
30 | 69 | runs-on: ubuntu-latest |
| 70 | + if: ${{ needs.setup-matrix.outputs.has_jobs == 'true' }} |
31 | 71 | permissions: |
32 | 72 | contents: read |
33 | 73 | packages: write |
34 | 74 |
|
35 | 75 | strategy: |
36 | 76 | fail-fast: false |
37 | | - matrix: |
38 | | - include: |
39 | | - - container: apphandler |
40 | | - context: ./daemons/apphandler |
41 | | - - container: authhandler |
42 | | - context: ./daemons/authhandler |
43 | | - - container: avsdispatcher |
44 | | - context: ./daemons/avsdispatcher |
45 | | - - container: housekeeping |
46 | | - context: ./daemons/housekeeping |
47 | | - - container: ltihandler |
48 | | - context: ./daemons/ltihandler |
49 | | - - container: notepadhandler |
50 | | - context: ./daemons/notepadhandler |
51 | | - - container: noteshandler |
52 | | - context: ./daemons/noteshandler |
53 | | - - container: staticserver |
54 | | - context: ./daemons/staticserver |
55 | | - if: >- |
56 | | - !startsWith(github.ref, 'refs/tags/') || |
57 | | - contains(github.ref_name, matrix.container) |
| 77 | + matrix: ${{ fromJSON(needs.setup-matrix.outputs.matrix) }} |
58 | 78 |
|
59 | 79 | steps: |
60 | 80 | - name: Checkout repository |
|
0 commit comments