github: automate release artifact creation

This commit is contained in:
Dedy Martadinata 2022-10-12 22:49:41 +07:00 committed by GitHub
parent d592b10c87
commit 92178d2e77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 }}