Skip to content

Commit

Permalink
Due to succession of arm32 and amd64 build steps, even arm32 deb pack…
Browse files Browse the repository at this point in the history
…age was built with amd64 binaris, fixed this issue, created different jobs for different builds, stored their results in artifacts, and created new release in the 3rd job, which depended on first two build jobs
  • Loading branch information
VedantParanjape committed Jul 27, 2020
1 parent c07d74e commit bc9f84b
Showing 1 changed file with 54 additions and 9 deletions.
63 changes: 54 additions & 9 deletions .github/workflows/build_deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,73 @@ on:
types: build-deb-package

jobs:
build_simppru_debian_job:
build_amd64_debian_package:
runs-on: ubuntu-latest
name: This will build simppru debian packages
name: This will build simppru debian packages for amd64
steps:
- name: Checkout
uses: actions/checkout@v2
- name: preconfig
run: sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: build inside docker amd64
uses: ./.github/action_build_amd64
- name: postconfig
run: |
amd64__filename__=$(echo $(ls build | grep ..amd64.deb) | tr -d '\n')
echo "::set-env name=amd64__filename__::$amd64__filename__"
- name: upload amd64 package to artifacts
uses: actions/upload-artifact@v2
with:
name: amd64-package
path: ./build/${{ env.amd64__filename__ }}

build_arm32_debian_package:
runs-on: ubuntu-latest
name: This will build simppru debian package for arm32
steps:
- name: Checkout
uses: actions/checkout@v2
- name: preconfig
run: sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: build inside docker arm32
uses: ./.github/action_build_arm32
- name: postconfig
run: |
foo_filename__=$(echo $(ls build | grep ..amd64.deb) | tr -d '\n');name__=$(echo ${foo_filename__%-*} | tr -d '\n')
foo_filename_=$(echo $(ls build | grep ..amd64.deb) | tr -d '\n');version__name__=${foo_filename_#*-};version__=$(echo ${version__name__%-*} | tr -d '\n')
arm32__filename__=$(echo $(ls build | grep ..armhf.deb) | tr -d '\n')
amd64__filename__=$(echo $(ls build | grep ..amd64.deb) | tr -d '\n')
echo "::set-env name=arm32__filename__::$arm32__filename__"
- name: upload arm32 package to artifacts
uses: actions/upload-artifact@v2
with:
name: arm32-package
path: ./build/${{ env.arm32__filename__ }}

create_debian_package_release:
runs-on: ubuntu-latest
needs: [build_amd64_debian_package, build_arm32_debian_package]
name: This will create a new release, and upload both packages to it
steps:
- name: Download artifacts amd64
id: amd64-artifact-download
uses: actions/download-artifact@v2
with:
name: amd64-package
path: .
- name: Download artifacts arm32
id: arm32-artifact-download
uses: actions/download-artifact@v2
with:
name: arm32-package
path: .
- name: postconfig
run: |
foo_filename__=$(echo $(ls ${{steps.amd64-artifact-download.outputs.download-path}} | grep ..amd64.deb) | tr -d '\n');name__=$(echo ${foo_filename__%-*} | tr -d '\n')
foo_filename_=$(echo $(ls ${{steps.amd64-artifact-download.outputs.download-path}} | grep ..amd64.deb) | tr -d '\n');version__name__=${foo_filename_#*-};version__=$(echo ${version__name__%-*} | tr -d '\n')
arm32__filename__=$(echo $(ls ${{steps.amd64-artifact-download.outputs.download-path}} | grep ..armhf.deb) | tr -d '\n')
amd64__filename__=$(echo $(ls ${{steps.amd64-artifact-download.outputs.download-path}} | grep ..amd64.deb) | tr -d '\n')
echo "::set-env name=name__::$name__"
echo "::set-env name=version__::$version__"
echo "::set-env name=arm32__filename__::$arm32__filename__"
echo "::set-env name=amd64__filename__::$amd64__filename__"
echo "::set-env name=amd64__filename__::$amd64__filename__"
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -34,15 +79,15 @@ jobs:
tag_name: ${{ env.version__ }}
release_name: ${{ env.name__ }}
draft: false
prerelease: false
prerelease: false
- name: Upload amd64 Release Asset
id: amd64_release_asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.amd64__filename__ }}
asset_path: ${{steps.amd64-artifact-download.outputs.download-path}}/${{ env.amd64__filename__ }}
asset_name: ${{ env.amd64__filename__ }}
asset_content_type: application/vnd.debian.binary-package
- name: Upload arm32 Release Asset
Expand All @@ -52,7 +97,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.arm32__filename__ }}
asset_path: ${{steps.amd64-artifact-download.outputs.download-path}}/${{ env.arm32__filename__ }}
asset_name: ${{ env.arm32__filename__ }}
asset_content_type: application/vnd.debian.binary-package

0 comments on commit bc9f84b

Please sign in to comment.