Package #1319
This file contains 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: Package | |
on: | |
push: | |
branches: | |
- master | |
- 'maintenance/**' | |
tags: | |
- '*' | |
pull_request: | |
schedule: | |
- cron: | | |
0 0 * * * | |
concurrency: | |
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
source: | |
name: Source | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt update -o="APT::Acquire::Retries=3" | |
sudo apt install -y -V -o="APT::Acquire::Retries=3" \ | |
autoconf-archive \ | |
devscripts \ | |
python3-pip \ | |
ruby \ | |
zip | |
sudo pip3 install -U pip | |
- name: Install Sphinx | |
run: | | |
sudo pip3 install -U \ | |
Jinja2 \ | |
Pygments \ | |
"Sphinx==5.3.0" \ | |
pydata_sphinx_theme | |
- name: Clone dependencies | |
run: | | |
cd .. | |
git clone --depth 1 https://github.com/groonga/groonga.org.git | |
git clone --depth 1 https://github.com/clear-code/cutter.git | |
- name: Generate configure | |
run: | | |
./autogen.sh | |
- name: Configure for archive | |
run: | | |
./configure \ | |
--enable-document \ | |
--enable-mruby \ | |
--with-cutter-source-path=../cutter \ | |
--with-groonga-org-path=../groonga.org \ | |
--with-ruby | |
- name: Build archive | |
run: | | |
make dist | |
- name: Create zip | |
run: | | |
version=$(cat base_version) | |
tar xzf groonga-${version}.tar.gz | |
pushd groonga-${version}/vendor | |
ruby download_lz4.rb | |
ruby download_mecab.rb | |
ruby download_message_pack.rb | |
ruby download_rapidjson.rb | |
ruby download.rb | |
popd | |
zip -r groonga-${version}.zip groonga-${version} | |
rm -rf groonga-${version} | |
# Artifact | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: source | |
path: | | |
groonga-*.tar.gz | |
groonga-*.zip | |
# Release | |
- name: Upload to release | |
uses: softprops/action-gh-release@v1 | |
if: | | |
startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
groonga-*.tar.gz | |
groonga-*.zip | |
build: | |
name: Build | |
needs: source | |
strategy: | |
fail-fast: false | |
matrix: | |
label: | |
- Debian GNU/Linux bullseye amd64 | |
- Debian GNU/Linux bullseye arm64 | |
- CentOS 7 x86_64 | |
- Amazon Linux 2 x86_64 | |
- AlmaLinux 8 x86_64 | |
- AlmaLinux 8 aarch64 | |
- AlmaLinux 9 x86_64 | |
- AlmaLinux 9 aarch64 | |
include: | |
- label: Debian GNU/Linux bullseye amd64 | |
id: debian-bullseye-amd64 | |
task-namespace: apt | |
target: debian-bullseye | |
test-docker-image: debian:bullseye | |
- label: Debian GNU/Linux bullseye arm64 | |
id: debian-bullseye-arm64 | |
task-namespace: apt | |
target: debian-bullseye-arm64 | |
test-docker-image: arm64v8/debian:bullseye | |
- label: CentOS 7 x86_64 | |
id: centos-7-x86_64 | |
task-namespace: yum | |
target: centos-7 | |
test-docker-image: centos:7 | |
- label: Amazon Linux 2 x86_64 | |
id: amazon-linux-2-x86_64 | |
task-namespace: yum | |
target: amazon-linux-2 | |
test-docker-image: amazonlinux:2 | |
- label: AlmaLinux 8 x86_64 | |
id: almalinux-8-x86_64 | |
task-namespace: yum | |
target: almalinux-8 | |
test-docker-image: almalinux:8 | |
- label: AlmaLinux 8 aarch64 | |
id: almalinux-8-aarch64 | |
task-namespace: yum | |
target: almalinux-8-aarch64 | |
test-docker-image: arm64v8/almalinux:8 | |
- label: AlmaLinux 9 x86_64 | |
id: almalinux-9-x86_64 | |
task-namespace: yum | |
target: almalinux-9 | |
test-docker-image: almalinux:9 | |
- label: AlmaLinux 9 aarch64 | |
id: almalinux-9-aarch64 | |
task-namespace: yum | |
target: almalinux-9-aarch64 | |
test-docker-image: arm64v8/almalinux:9 | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt update -o="APT::Acquire::Retries=3" | |
sudo apt install -y -V -o="APT::Acquire::Retries=3" \ | |
devscripts \ | |
qemu-user-static \ | |
ruby | |
- uses: actions/download-artifact@v3 | |
with: | |
name: source | |
- name: Update version | |
if: | | |
!startsWith(github.ref, 'refs/tags/') && | |
!startsWith(github.ref, 'refs/heads/maintenance/') | |
run: | | |
cd packages | |
rake version:update RELEASE_DATE=$(date +%Y-%m-%d) | |
- name: Login to GitHub Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Cache ccache | |
uses: actions/cache@v3 | |
with: | |
path: packages/${{ matrix.task-namespace }}/build/${{ matrix.target }}/ccache | |
key: package-${{ matrix.id }}-ccache-${{ hashFiles('lib/**', 'src/**', 'plugins/**', 'include/**') }} | |
restore-keys: package-${{ matrix.id }}-ccache- | |
- name: Build with docker | |
run: | | |
cd packages | |
rake docker:pull || : | |
rake ${{ matrix.task-namespace }}:build BUILD_DIR=build | |
env: | |
APT_TARGETS: ${{ matrix.target }} | |
YUM_TARGETS: ${{ matrix.target }} | |
- name: Push the built Docker image | |
continue-on-error: true | |
run: | | |
cd packages | |
rake docker:push | |
env: | |
APT_TARGETS: ${{ matrix.target }} | |
YUM_TARGETS: ${{ matrix.target }} | |
# Artifact | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: packages-${{ matrix.id }} | |
path: packages/${{ matrix.task-namespace }}/repositories/ | |
# Release | |
- name: Create assets | |
if: | | |
startsWith(github.ref, 'refs/tags/') | |
run: | | |
tar czf ${{ matrix.id }}.tar.gz packages/${{ matrix.task-namespace }}/repositories/ | |
- name: Upload to release | |
uses: softprops/action-gh-release@v1 | |
if: | | |
startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
${{ matrix.id }}.tar.gz | |
# Test | |
- name: Test | |
run: | | |
docker run \ | |
--rm \ | |
--volume ${PWD}:/groonga:ro \ | |
${{ matrix.test-docker-image }} \ | |
/groonga/packages/${{ matrix.task-namespace }}/test.sh |