-
Notifications
You must be signed in to change notification settings - Fork 9
115 lines (114 loc) · 3.24 KB
/
package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Package
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- "*"
schedule:
- cron: |
0 0 * * *
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
id:
- debian-bullseye-amd64
- debian-bullseye-arm64
- debian-bookworm-amd64
- debian-bookworm-arm64
- debian-trixie-amd64
- debian-trixie-arm64
- centos-7
- almalinux-8
- almalinux-8-aarch64
- almalinux-9
- almalinux-9-aarch64
runs-on: ubuntu-latest
steps:
- name: Prepare environment variables
run: |
set -eux
id=${{ matrix.id }}
case ${id} in
debian-*)
echo "APT_TARGETS=${id%-amd64}" >> ${GITHUB_ENV}
echo "TASK_NAMESPACE=apt" >> ${GITHUB_ENV}
;;
*)
echo "YUM_TARGETS=${id}" >> ${GITHUB_ENV}
echo "TASK_NAMESPACE=yum" >> ${GITHUB_ENV}
;;
esac
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
path: groonga
repository: groonga/groonga
submodules: recursive
- 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: Generate configure
run: |
./autogen.sh
- name: Configure for archive
run: |
./configure
- name: Build archive
run: |
make dist
- name: Upload to release
if: |
github.ref_type == 'tag'
run: |
ruby \
-e 'print("## groonga-normalizer-mysql "); \
puts(ARGF.read.split(/^## /)[1].strip)' \
doc/text/news.md > release-note.md
version=${GITHUB_REF_NAME#v}
title="$(head -n1 release-note.md | sed -e 's/^## //')"
tail -n +2 release-note.md > release-note-without-version.md
gh release create ${GITHUB_REF_NAME} \
--discussion-category Announcements \
--notes-file release-note-without-version.md \
--title "${title}" \
groonga-normalizer-mysql-*.tar.gz
env:
GH_TOKEN: ${{ github.token }}
- name: Build with docker
run: |
cd packages
rake version:update
rake ${TASK_NAMESPACE}:build
env:
GROONGA_REPOSITORY: ../groonga
- uses: actions/upload-artifact@v3
with:
name: packages-${{ matrix.id }}
path: packages/${{ env.TASK_NAMESPACE }}/repositories/
# Release
- name: Upload to release
if: |
github.ref_type == 'tag'
run: |
tar czf ${{ matrix.id }}.tar.gz \
packages/${{ env.TASK_NAMESPACE }}/repositories/
gh release upload ${GITHUB_REF_NAME} \
${{ matrix.id }}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}