From fa7735f593c0e7e8a9349ee7ada83e2496c2f925 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Sun, 1 Jun 2025 23:47:35 +0300 Subject: [PATCH] [ci] Move publishing dist tarball from CircleCI to GitHub Actions --- .ci/publish_release_artifact.sh | 22 ------------------- .circleci/config.yml | 39 --------------------------------- .github/workflows/linux-ci.yml | 38 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 61 deletions(-) delete mode 100755 .ci/publish_release_artifact.sh diff --git a/.ci/publish_release_artifact.sh b/.ci/publish_release_artifact.sh deleted file mode 100755 index f948e68c2..000000000 --- a/.ci/publish_release_artifact.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -if [[ -z $GITHUB_TOKEN ]]; then - echo "No GITHUB_TOKEN secret found, artifact publishing skipped" - exit -fi - -if ! hash ghr 2> /dev/null; then - _GHR_VER=v0.14.0 - _GHR=ghr_${_GHR_VER}_linux_amd64 - curl -sfL https://github.com/tcnksm/ghr/releases/download/$_GHR_VER/$_GHR.tar.gz | - tar xz -C . --strip-components=1 $_GHR/ghr -fi - -./ghr -replace \ - -u $CIRCLE_PROJECT_USERNAME \ - -r $CIRCLE_PROJECT_REPONAME \ - $CIRCLE_TAG \ - $1 diff --git a/.circleci/config.yml b/.circleci/config.yml index 5db84b169..7c949654b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,5 @@ version: 2.1 -executors: - dist-executor: - docker: - - image: cimg/base:2023.10 - jobs: macos-aat-fonts: @@ -21,28 +16,6 @@ jobs: - store_artifacts: path: build/meson-logs/ - dist: - executor: dist-executor - steps: - - checkout - - run: sudo apt update || true - - run: DEBIAN_FRONTEND=noninteractive sudo apt install -y git ninja-build binutils gcc g++ pkg-config ragel gtk-doc-tools gobject-introspection libfreetype6-dev libglib2.0-dev libgirepository1.0-dev libcairo2-dev libicu-dev libgraphite2-dev python3 python3-pip - - run: pip3 install fonttools meson --upgrade - - run: meson setup build - - run: meson dist --no-tests -Cbuild - - persist_to_workspace: - root: . - paths: [build/meson-dist/harfbuzz-*.tar.xz] - - publish-dist: - executor: dist-executor - steps: - - checkout - - attach_workspace: - at: . - - run: | - .ci/publish_release_artifact.sh build/meson-dist/harfbuzz-$CIRCLE_TAG.tar.xz - fedora-valgrind: docker: - image: fedora:36 @@ -68,17 +41,5 @@ workflows: build: jobs: - macos-aat-fonts - - dist: - filters: # must have filter or won't work as a dependency - tags: - only: /.*/ - - publish-dist: - requires: - - dist - filters: - tags: - only: /^\d+\.\d+\.\d+$/ - branches: - ignore: /.*/ - fedora-valgrind - clang-cxx2a diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml index 802c68cc5..376d55f6e 100644 --- a/.github/workflows/linux-ci.yml +++ b/.github/workflows/linux-ci.yml @@ -56,6 +56,10 @@ jobs: run: meson compile -Cbuild - name: Test run: meson test --print-errorlogs -Cbuild + - name: Dist + run: | + git reset --hard HEAD # ragel may have modified the source tree + meson dist --no-tests -Cbuild - name: Generate Documentations run: ninja -Cbuild harfbuzz-doc - name: Deploy Documentations @@ -64,3 +68,37 @@ jobs: env: GH_TOKEN: ${{ secrets.GH_TOKEN }} REVISION: ${{ github.sha }} + - name: Archive artifacts + uses: actions/upload-artifact@v4 + with: + name: harfbuzz + path: build/meson-dist/harfbuzz-*.tar.xz + if-no-files-found: error + + release: + name: Create and populate release + needs: build + runs-on: ubuntu-24.04 + if: contains(github.ref, 'refs/tags/') + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: harfbuzz + - name: Extract artifacts + run: | + ls -R + unzip harfbuzz.zip + ls -R + - name: Check for release + id: create_release + run: | + if ! gh release view ${{ github.ref_name }}; then + git show -s --format=%B ${{ github.ref_name }} | tail -n +4 | gh release create ${{ github.ref_name }} -t ${{ github.ref_name }} -F - + fi + - name: Populate release + run: | + gh release upload ${{ github.ref_name }} harfbuzz-${{ github.ref_name }}.tar.xz --clobber