Merge pull request #624 from fredericve/master #245
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: App Builder | |
| on: | |
| release: | |
| type: [published] | |
| push: | |
| branches: [ master, main ] | |
| paths-ignore: | |
| - '**.md' | |
| - '**.yml' | |
| pull_request: | |
| branches: [ master, main ] | |
| paths-ignore: | |
| - '**.md' | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: 1.24.5 | |
| - name: Build Frontend | |
| if: github.event_name != 'pull_request' | |
| run: echo y | ./scripts/build_frontend.sh | |
| - name: Build Binary | |
| run: echo y |./scripts/build_binary.sh | |
| - name: Build Packages | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| sed -i 's|goreleaser/nfpm|goreleaser/nfpm|g' scripts/build_package.sh | |
| RELEASE=$(./homer-app -version | egrep -o '[0-9].[0-9].[0-9]+') | |
| echo "TAG_NAME=$RELEASE" >> $GITHUB_ENV | |
| VERSION=$RELEASE make package | |
| - name: Archive Frontend | |
| if: github.event_name != 'pull_request' | |
| run: tar cvfz homer-ui-${{env.TAG_NAME}}.tgz dist | |
| - name: Upload release | |
| if: github.event_name != 'pull_request' | |
| uses: boxpositron/upload-multiple-releases@1.0.7 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| release_config: | | |
| homer-app | |
| homer-app-${{ env.TAG_NAME }}-amd64.deb | |
| homer-app-${{ env.TAG_NAME }}-amd64.rpm | |
| homer-ui-${{ env.TAG_NAME }}.tgz | |
| tag_name: ${{ env.TAG_NAME }} | |
| release_name: homer-app-${{ env.TAG_NAME }} | |
| draft: false | |
| prerelease: false | |
| overwrite: true | |
| - name: Check PACKAGECLOUD secret presence | |
| id: checkpackagecloud | |
| shell: bash | |
| run: | | |
| if [ "$SECRET" == "" ] || [ "$USERNAME" == "" ]; then | |
| echo "secretspresent=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "secretspresent=true" >> $GITHUB_OUTPUT | |
| fi | |
| env: | |
| SECRET: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
| USERNAME: ${{ secrets.PACKAGECLOUD_USERNAME }} | |
| - name: upload deb packagecloud | |
| if: ${{ steps.checkpackagecloud.outputs.secretspresent == 'true' }} | |
| uses: danielmundi/upload-packagecloud@v1 | |
| with: | |
| PACKAGE-NAME: homer-app-${{ env.TAG_NAME }}-amd64.deb | |
| PACKAGECLOUD-REPO: sipcapture | |
| PACKAGECLOUD-DISTRIB: any/any | |
| PACKAGECLOUD-USERNAME: ${{ secrets.PACKAGECLOUD_USERNAME }} | |
| PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
| continue-on-error: true | |
| - name: upload rpm packagecloud | |
| if: ${{ steps.checkpackagecloud.outputs.secretspresent == 'true' }} | |
| uses: danielmundi/upload-packagecloud@v1 | |
| with: | |
| PACKAGE-NAME: homer-app-${{ env.TAG_NAME }}-amd64.rpm | |
| PACKAGECLOUD-REPO: sipcapture | |
| PACKAGECLOUD-DISTRIB: rpm_any/rpm_any | |
| PACKAGECLOUD-USERNAME: ${{ secrets.PACKAGECLOUD_USERNAME }} | |
| PACKAGECLOUD-TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }} | |
| continue-on-error: true | |
| docker-prep: | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: write | |
| outputs: | |
| tag: ${{ steps.tag_bump.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - id: tag_bump | |
| name: Bump version and push tag | |
| uses: anothrNick/github-tag-action@1.39.0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DEFAULT_BUMP: none | |
| BRANCH: master | |
| docker-build-amd64: | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| needs: [build, docker-prep] | |
| permissions: | |
| packages: write | |
| contents: read | |
| outputs: | |
| digest: ${{ steps.build.outputs.digest }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v2.1.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@v3.2.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64 | |
| outputs: type=image,name=${{ env.REGISTRY }}/${{ github.repository }},push-by-digest=true,push=true | |
| docker-build-arm64: | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-24.04-arm | |
| needs: [build, docker-prep] | |
| permissions: | |
| packages: write | |
| contents: read | |
| outputs: | |
| digest: ${{ steps.build.outputs.digest }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v2.1.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: build | |
| uses: docker/build-push-action@v3.2.0 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/arm64 | |
| outputs: type=image,name=${{ env.REGISTRY }}/${{ github.repository }},push-by-digest=true,push=true | |
| docker-manifest: | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| needs: [docker-prep, docker-build-amd64, docker-build-arm64] | |
| permissions: | |
| packages: write | |
| contents: read | |
| steps: | |
| - uses: docker/setup-buildx-action@v4 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v2.1.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ${{ env.REGISTRY }}/${{ github.repository }}:latest \ | |
| -t ${{ env.REGISTRY }}/${{ github.repository }}:${{ needs.docker-prep.outputs.tag }} \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}@${{ needs.docker-build-amd64.outputs.digest }} \ | |
| ${{ env.REGISTRY }}/${{ github.repository }}@${{ needs.docker-build-arm64.outputs.digest }} |