From 92178d2e777b54b228cb8143af3104bb3949adcd Mon Sep 17 00:00:00 2001 From: Dedy Martadinata Date: Wed, 12 Oct 2022 22:49:41 +0700 Subject: [PATCH] github: automate release artifact creation --- .github/workflows/docker-build-static.yml | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/.github/workflows/docker-build-static.yml b/.github/workflows/docker-build-static.yml index 0cb13f9..02884c1 100644 --- a/.github/workflows/docker-build-static.yml +++ b/.github/workflows/docker-build-static.yml @@ -411,3 +411,75 @@ jobs: password: ${{ secrets.DOCKERHUB_PASSWORD }} repository: nitnelave/lldap + + create-release-artifacts: + needs: [build-ui,build-armhf,build-aarch64,build-amd64] + name: Create release artifacts + if: github.event_name == 'release' + runs-on: ubuntu-latest + steps: + + - name: Download armhf lldap artifacts + uses: actions/download-artifact@v3 + with: + name: armhf-lldap-bin + path: bin/armhf-bin + - name: Download armhf migration-tool artifacts + uses: actions/download-artifact@v3 + with: + name: armhf-migration-tool-bin + path: bin/armhf-bin + - name: Fix binary name armhf + run: mv bin/armhf-bin/lldap bin/armhf-bin/lldap-armhf && mv bin/armhf-bin/migration-tool bin/armhf-bin/migration-tool-armhf + + - name: Download aarch64 lldap artifacts + uses: actions/download-artifact@v3 + with: + name: aarch64-lldap-bin + path: bin/aarch64-bin + - name: Download aarch64 migration-tool artifacts + uses: actions/download-artifact@v3 + with: + name: aarch64-migration-tool-bin + path: bin/aarch64-bin + - name: Fix binary name aarch64 + run: mv bin/aarch64-bin/lldap bin/aarch64-bin/lldap-aarch64 && mv bin/aarch64-bin/migration-tool bin/aarch64-bin/migration-tool-aarch64 + + - name: Download amd64 lldap artifacts + uses: actions/download-artifact@v3 + with: + name: amd64-lldap-bin + path: bin/amd64-bin + - name: Download amd64 migration-tool artifacts + uses: actions/download-artifact@v3 + with: + name: amd64-migration-tool-bin + path: bin/amd64-bin + - name: Fix binary name amd64 + run: mv bin/amd64-bin/lldap bin/amd64-bin/lldap-amd64 && mv bin/amd64-bin/migration-tool bin/amd64-bin/migration-tool-amd64 + + - name: Download llap ui artifacts + uses: actions/download-artifact@v3 + with: + name: ui + path: web + - name: Web Cleanup + run: mkdir app && mv web/index.html app/index.html && mv web/static app/static && mv web/pkg app/pkg + - name: compress web + run: sudo apt update && sudo apt install -y zip && zip -r web.zip app/ + + + - name: Upload artifacts release + uses: ncipollo/release-action@v1 + id: create_release + with: + allowUpdates: true + artifacts: "bin/armhf-bin/lldap-armhf, + bin/aarch64-bin/lldap-aarch64, + bin/amd64-bin/lldap-amd64, + bin/armhf-bin/migration-tool-armhf, + bin/aarch64-bin/migration-tool-aarch64, + bin/amd64-bin/migration-tool-amd64, + web.zip" + env: + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file