From 9822aad2eaabfb0625f0fa0c4ad18ed874b295f2 Mon Sep 17 00:00:00 2001 From: Shenghang Tsai Date: Wed, 4 Dec 2024 12:34:24 +0800 Subject: [PATCH] add --- .github/workflows/arm_release.yml | 37 ------------------------------- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++ scripts/build-for-publish.sh | 1 + 3 files changed, 36 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/arm_release.yml diff --git a/.github/workflows/arm_release.yml b/.github/workflows/arm_release.yml deleted file mode 100644 index 9ad08aed6..000000000 --- a/.github/workflows/arm_release.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Livebook Build - -on: - push: - branches: - - main - - release-0.4.0 - pull_request: - branches: ["main"] - paths-ignore: - - "*.md" - - "**/*.md" - - "LICENSE*" -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: ${{ secrets.DOCKERHUB_USERNAME != '' }} - tags: ${{ secrets.DOCKERHUB_USERNAME }}/beaver-livebook:latest - cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/beaver-livebook:latest - cache-to: type=inline - platforms: | - linux/arm64/v8 - file: docker/livebook.dockerfile - - run: docker run --platform linux/arm64/v8 ${{ secrets.DOCKERHUB_USERNAME }}/beaver-livebook:latest pwd diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6fab02d80..dea558672 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - release* tags: - "*" pull_request: @@ -131,3 +132,37 @@ jobs: BEAVER_ARTEFACT_URL: "https://github.com/beaver-lodge/beaver-prebuilt/releases/download/${{ needs.generate_id.outputs.formatted_date }}/@{artefact_filename}" run: | mix run bench/enif_add_benchmark.exs + + arm_docker: + needs: [generate_id] + runs-on: ubuntu-latest + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: ${{ secrets.DOCKERHUB_USERNAME != '' }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/beaver-livebook:latest + cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/beaver-livebook:latest + cache-to: type=inline + platforms: | + linux/arm64/v8 + file: docker/livebook.dockerfile + - run: docker run --platform linux/arm64/v8 -v $PWD:/src -w /src ${{ secrets.DOCKERHUB_USERNAME }}/beaver-livebook:latest bash scripts/build-for-publish.sh + - name: Publish archives and packages + uses: softprops/action-gh-release@v1 + if: ${{ github.repository == 'beaver-lodge/beaver' && env.PRE_BUILT_RELEASE_GITHUB_TOKEN != null }} + with: + files: | + *.tar.gz + repository: beaver-lodge/beaver-prebuilt + token: ${{ secrets.PRE_BUILT_RELEASE_GITHUB_TOKEN }} + tag_name: ${{ needs.generate_id.outputs.formatted_date }} diff --git a/scripts/build-for-publish.sh b/scripts/build-for-publish.sh index 7020d03b7..f6fa4758c 100644 --- a/scripts/build-for-publish.sh +++ b/scripts/build-for-publish.sh @@ -1,4 +1,5 @@ set -e export MIX_ENV=prod export ELIXIR_MAKE_CACHE_DIR=. +mix deps.get mix elixir_make.precompile