Skip to content

build el8 and focal for new repo location #172

build el8 and focal for new repo location

build el8 and focal for new repo location #172

name: Build Packages
on:
push:
branches:
- build
tags:
- 'v*.*.*'
jobs:
prebuild:
runs-on: buildinator-5
outputs:
manifest: ${{ steps.prebuild.outputs.manifest }}
matrix: ${{ steps.prebuild.outputs.matrix }}
uuid: ${{ steps.prebuild.outputs.uuid }}
steps:
- name: Checkout
uses: actions/checkout@v3
- id: prebuild
name: Prebuild flow
uses: 45drives/actions/prebuild-flow@main
with:
directory: ${{ github.workspace }}
build:
needs: prebuild
runs-on: buildinator-group
strategy:
matrix:
build: ${{ fromJSON(needs.prebuild.outputs.matrix).include }}
steps:
- name: Build package
uses: 45drives/actions/build-package@main
with:
manifest: ${{ needs.prebuild.outputs.manifest }}
build: ${{ toJSON(matrix.build) }}
uuid: ${{ needs.prebuild.outputs.uuid }}
sign:
needs:
- prebuild
- build
runs-on: buildinator-5
steps:
- name: Run sign playbook
uses: 45drives/actions/ansible-playbook@main
with:
playbook: /root/git/auto-packaging/actions/ansible/sign.yml
directory: ${{ github.workspace }}/packaging
group_vars_directory: ${{ github.workspace }}/packaging/group_vars/
inventory: |
[ci]
localhost
become: true
host_key_checking: true
extra_vars: sign_key_name=prod
update_repositories:
needs:
- prebuild
- build
- sign
runs-on: buildinator-5
steps:
- id: push_local
name: Push packages into local repository
uses: 45drives/actions/update-repo@main
with:
directory: ${{ github.workspace }}
create_release:
needs:
- prebuild
- build
- sign
- update_repositories
runs-on: buildinator-5
steps:
- name: Set Variables
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "PRERELEASE=$([ "$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.stable')" = "true" ] && echo false || echo "true")" >> $GITHUB_ENV
echo "TITLE=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.title')" >> $GITHUB_ENV
echo "VERSION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.version')" >> $GITHUB_ENV
echo "REVISION=$(cat ${{github.workspace}}/manifest.json | jq --raw-output '.build_number')" >> $GITHUB_ENV
- name: GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: ${{env.TITLE}} ${{env.VERSION}}
prerelease: ${{env.PRERELEASE}}
body_path: ${{github.workspace}}/CHANGELOG.md
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
sync_repositories:
needs:
- prebuild
- build
- sign
- update_repositories
- create_release
runs-on: buildinator-5
steps:
- id: push_remote
name: Sync local repository with remote repository
if: startsWith(github.ref, 'refs/tags/')
uses: 45drives/actions/sync-repo@main
with:
directory: ${{ github.workspace }}