|
6 | 6 | tags: |
7 | 7 | - 'v*.*.*' |
8 | 8 | jobs: |
9 | | - main: |
10 | | - runs-on: deployinatorv1 |
| 9 | + prebuild: |
| 10 | + runs-on: buildinator-group |
| 11 | + outputs: |
| 12 | + manifest: ${{ steps.prebuild.outputs.manifest }} |
| 13 | + matrix: ${{ steps.prebuild.outputs.matrix }} |
| 14 | + uuid: ${{ steps.prebuild.outputs.uuid }} |
11 | 15 | steps: |
12 | 16 | - name: Checkout |
13 | | - uses: actions/checkout@v2 |
14 | | - - name: Package Binaries |
15 | | - run: build-packages ${{github.repository}} ${{github.workspace}} |
16 | | - - name: Set Variables |
17 | | - if: startsWith(github.ref, 'refs/tags/') |
18 | | - run: | |
19 | | - echo "PRERELEASE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.prerelease')" >> $GITHUB_ENV |
20 | | - echo "TITLE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.title')" >> $GITHUB_ENV |
21 | | - echo "VERSION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.version')" >> $GITHUB_ENV |
22 | | - echo "REVISION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.buildVersion')" >> $GITHUB_ENV |
23 | | - - name: GitHub Release |
24 | | - if: startsWith(github.ref, 'refs/tags/') |
25 | | - uses: softprops/action-gh-release@v1 |
| 17 | + uses: actions/checkout@v3 |
| 18 | + |
| 19 | + - id: prebuild |
| 20 | + name: Prebuild flow |
| 21 | + uses: 45drives/actions/prebuild-flow@main |
26 | 22 | with: |
27 | | - name: ${{env.TITLE}} ${{env.VERSION}} |
28 | | - prerelease: ${{env.PRERELEASE}} |
29 | | - body_path: ${{github.workspace}}/CHANGELOG.md |
30 | | - files: | |
31 | | - ${{github.workspace}}/dist/packages/*/*.deb |
32 | | - ${{github.workspace}}/dist/packages/*/*.rpm |
33 | | - env: |
34 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
35 | | - - name: Update Repository |
36 | | - if: startsWith(github.ref, 'refs/tags/') |
37 | | - run: update-repositories ${{github.workspace}} |
38 | | - - name: Publish Repository |
| 23 | + directory: ${{ github.workspace }} |
| 24 | + |
| 25 | + build: |
| 26 | + needs: prebuild |
| 27 | + runs-on: buildinator-group |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + build: ${{ fromJSON(needs.prebuild.outputs.matrix).include }} |
| 31 | + steps: |
| 32 | + - name: Build package |
| 33 | + uses: 45drives/actions/build-package@main |
| 34 | + with: |
| 35 | + manifest: ${{ needs.prebuild.outputs.manifest }} |
| 36 | + build: ${{ toJSON(matrix.build) }} |
| 37 | + uuid: ${{ needs.prebuild.outputs.uuid }} |
| 38 | + |
| 39 | + sign: |
| 40 | + needs: |
| 41 | + - prebuild |
| 42 | + - build |
| 43 | + runs-on: buildinator-group |
| 44 | + steps: |
| 45 | + - name: Run sign playbook |
| 46 | + uses: 45drives/actions/ansible-playbook@main |
| 47 | + with: |
| 48 | + playbook: /root/git/auto-packaging/actions/ansible/sign.yml |
| 49 | + directory: ${{ github.workspace }}/packaging |
| 50 | + group_vars_directory: ${{ github.workspace }}/packaging/group_vars/ |
| 51 | + inventory: | |
| 52 | + [ci] |
| 53 | + localhost |
| 54 | + become: true |
| 55 | + host_key_checking: true |
| 56 | + extra_vars: sign_key_name=prod |
| 57 | + |
| 58 | + update_repositories: |
| 59 | + needs: |
| 60 | + - prebuild |
| 61 | + - build |
| 62 | + - sign |
| 63 | + runs-on: buildinator-group |
| 64 | + steps: |
| 65 | + - id: push_local |
| 66 | + name: Push packages into local repository |
| 67 | + uses: 45drives/actions/update-repo@main |
| 68 | + with: |
| 69 | + directory: ${{ github.workspace }} |
| 70 | + |
| 71 | + sync_repositories: |
| 72 | + needs: |
| 73 | + - prebuild |
| 74 | + - build |
| 75 | + - sign |
| 76 | + - update_repositories |
| 77 | + runs-on: buildinator-group |
| 78 | + steps: |
| 79 | + - id: push_remote |
| 80 | + name: Sync local repository with remote repository |
39 | 81 | if: startsWith(github.ref, 'refs/tags/') |
40 | | - run: publish-repo |
| 82 | + uses: 45drives/actions/sync-repo@main |
| 83 | + with: |
| 84 | + directory: ${{ github.workspace }} |
0 commit comments