Package #890
Workflow file for this run
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: | |
- "*" | |
tags: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
schedule: | |
- cron: | | |
0 0 * * * | |
jobs: | |
build: | |
name: Build | |
strategy: | |
fail-fast: false | |
matrix: | |
label: | |
- Debian GNU/Linux bullseye amd64 | |
- Debian GNU/Linux bullseye arm64 | |
- CentOS 7 | |
- Amazon Linux 2 | |
- AlmaLinux 8 | |
- AlmaLinux 9 | |
include: | |
- label: Debian GNU/Linux bullseye amd64 | |
id: debian-bullseye-amd64 | |
task-namespace: apt | |
rake_arguments: apt:build APT_TARGETS=debian-bullseye | |
repositories_path: packages/apt/repositories/ | |
- label: Debian GNU/Linux bullseye arm64 | |
id: debian-bullseye-arm64 | |
task-namespace: apt | |
rake_arguments: apt:build APT_TARGETS=debian-bullseye-arm64 | |
repositories_path: packages/apt/repositories/ | |
- label: CentOS 7 | |
id: centos-7 | |
task-namespace: yum | |
rake_arguments: yum:build YUM_TARGETS=centos-7 | |
repositories_path: packages/yum/repositories/ | |
- label: Amazon Linux 2 | |
id: amazon-linux-2 | |
task-namespace: yum | |
rake_arguments: yum:build YUM_TARGETS=amazon-linux-2 | |
repositories_path: packages/yum/repositories/ | |
- label: AlmaLinux 8 | |
id: almalinux-8 | |
task-namespace: yum | |
rake_arguments: yum:build YUM_TARGETS=almalinux-8 | |
repositories_path: packages/yum/repositories/ | |
- label: AlmaLinux 8 aarch64 | |
id: almalinux-8-aarch64 | |
task-namespace: yum | |
rake_arguments: yum:build YUM_TARGETS=almalinux-8-aarch64 | |
repositories_path: packages/yum/repositories/ | |
- label: AlmaLinux 9 | |
id: almalinux-9 | |
task-namespace: yum | |
rake_arguments: yum:build YUM_TARGETS=almalinux-9 | |
repositories_path: packages/yum/repositories/ | |
- label: AlmaLinux 9 aarch64 | |
id: almalinux-9-aarch64 | |
task-namespace: yum | |
rake_arguments: yum:build YUM_TARGETS=almalinux-9-aarch64 | |
repositories_path: packages/yum/repositories/ | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt -y -V install software-properties-common | |
sudo add-apt-repository -y universe | |
sudo add-apt-repository -y ppa:groonga/ppa | |
sudo apt update | |
sudo apt -V install \ | |
devscripts \ | |
libgroonga-dev \ | |
qemu-user-static \ | |
ruby | |
- name: Clone dependencies | |
run: | | |
cd .. | |
git clone --depth 1 --recursive https://github.com/groonga/groonga.git | |
- name: Generate configure | |
run: | | |
./autogen.sh | |
- name: Configure for archive | |
run: | | |
./configure | |
- name: Build archive | |
run: | | |
make dist | |
- name: Build with docker | |
run: | | |
cd packages | |
rake version:update | |
rake ${{ matrix.rake_arguments }} | |
env: | |
GROONGA_REPOSITORY: ../../groonga | |
- uses: actions/upload-artifact@master | |
with: | |
name: packages-${{ matrix.id }} | |
path: ${{ matrix.repositories_path }} | |
# Release | |
- name: Create assets | |
if: | | |
startsWith(github.ref, 'refs/tags/') | |
run: | | |
tar czf ${{ matrix.id }}.tar.gz packages/${{ matrix.task-namespace }}/repositories/ | |
- name: Ensure creating release | |
if: | | |
startsWith(github.ref, 'refs/tags/') | |
id: create-release | |
uses: actions/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
result-encoding: string | |
script: | | |
const AsyncFunction = Object.getPrototypeOf(async () => {}).constructor | |
const fs = require("fs"); | |
const path = ".github/workflows/ensure-creating-release.js"; | |
const script = fs.readFileSync(path).toString(); | |
const func = new AsyncFunction("require", "github", "context", script); | |
return await func(require, github, context); | |
- name: Upload to release | |
uses: actions/[email protected] | |
if: | | |
startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.result }} | |
asset_path: ${{ matrix.id }}.tar.gz | |
asset_name: ${{ matrix.id }}.tar.gz | |
asset_content_type: application/gzip |