From 52c6010df710b18b5d796326439d536ed1de4039 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Wed, 20 Dec 2023 21:19:34 +0900 Subject: [PATCH] fix(github-actions): fix release flow (#1064) --- .github/workflows/release-please.yml | 44 +++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 6f0534cb..fcfe9faa 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -4,9 +4,16 @@ on: push: branches: [main] +env: + LIBAOM_VERSION: 3.8.0 + LIBWEBP_VERSION: 1.3.2 + jobs: release-please: runs-on: ubuntu-22.04 + permissions: + contents: write + packages: write steps: - id: generate_token @@ -18,15 +25,14 @@ jobs: uses: google-github-actions/release-please-action@v4 with: token: ${{ steps.generate_token.outputs.token }} - - if: ${{ steps.release.outputs.release_created }} + - name: Checkout uses: actions/checkout@v4 - if: ${{ steps.release.outputs.release_created }} name: Set up QEMU uses: actions/setup-go@v5 with: go-version: 1.21 - - if: ${{ steps.release.outputs.release_created }} - id: meta + - id: meta name: Docker meta uses: docker/metadata-action@v5 with: @@ -48,7 +54,37 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - if: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y yasm + - name: Install libwebp + run: | + mkdir -p /tmp/src + cd /tmp/src + wget -O libwebp.tar.gz https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${LIBWEBP_VERSION}.tar.gz + tar -xzf libwebp.tar.gz -C /tmp/src + rm libwebp.tar.gz + cd /tmp/src/libwebp-${LIBWEBP_VERSION} + ./configure --prefix /tmp/libwebp + make -j4 + make install + - name: Install libaom + run: | + mkdir -p /tmp/src + cd /tmp/src + wget -O libaom.tar.gz https://storage.googleapis.com/aom-releases/libaom-${LIBAOM_VERSION}.tar.gz + mkdir -p /tmp/src/libaom-${LIBAOM_VERSION} + tar -xzf libaom.tar.gz -C /tmp/src + rm libaom.tar.gz + mkdir -p /tmp/src/aom_build + cd /tmp/src/aom_build + cmake /tmp/src/libaom-${LIBAOM_VERSION} -DCMAKE_INSTALL_PREFIX=/tmp/libaom + make -j4 + make install + - env: + CGO_CFLAGS: -I/tmp/libwebp/include -I/tmp/libaom/include + CGO_LDFLAGS: -L/tmp/libwebp/lib -lwebp -L/tmp/libaom/lib -laom -lm name: Build and push uses: docker/build-push-action@v5 with: