-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (138 loc) · 4.05 KB
/
release.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: build release binaries
on:
pull_request:
release:
types: [created]
permissions:
contents: write
id-token: write
attestations: write
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install gettext
- uses: actions/checkout@v4
- name: build mecab
run: |
./autogen.sh
./configure
make -j$(nproc) all
sudo make install
make dist
mkdir -p ../dist/mecab/
mv mecab-*.tar.gz ../dist/mecab/
make script-dist
mkdir -p ../dist/scripts/
mv mecab-*.tar.gz ../dist/scripts/
mecab-config --version > ../dist/mecab-version.txt
working-directory: mecab
- name: build ipadic
run: |
./autogen.sh
./configure
make dist
mkdir -p ../dist/mecab-ipadic/
mv mecab-ipadic-*.tar.gz ../dist/mecab-ipadic/
working-directory: mecab-ipadic
- name: build jumandic
run: |
./autogen.sh
./configure
make dist
mkdir -p ../dist/mecab-jumandic/
mv mecab-jumandic-*.tar.gz ../dist/mecab-jumandic/
working-directory: mecab-jumandic
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist
- name: Upload Release Assets
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: |
dist/**/*.tar.gz
if: github.event_name == 'release'
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: |
dist/**/*.tar.gz
if: github.event_name == 'release'
windows:
name: windows
runs-on: windows-2019
needs: build
strategy:
fail-fast: false
matrix:
machine:
- x64
- x86
steps:
- run: git config --global core.autoCRLF false
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: check mecab version
id: mecab
run: |
echo "version=$(cat mecab-version.txt)" >> "$GITHUB_OUTPUT"
shell: bash
working-directory: dist
- name: untar mecab
run: |
tar xzvf mecab-*.tar.gz
rm mecab-*.tar.gz
mv mecab-*/* .
shell: bash
working-directory: dist/mecab
- name: untar ipadic
run: |
tar xzvf mecab-ipadic-*.tar.gz
rm mecab-ipadic-*.tar.gz
mv mecab-ipadic-*/* .
shell: bash
working-directory: dist/mecab-ipadic
- name: untar python binding
run: |
tar xzvf mecab-python-*.tar.gz
rm mecab-*.tar.gz
mv mecab-python-*/* .
shell: bash
working-directory: dist/scripts
- name: build
run: call .github\build-windows.bat
shell: cmd
env:
BUILD_TYPE: ${{ matrix.machine }}
MECAB_VERSION: ${{ steps.mecab.outputs.version }}
- uses: actions/upload-artifact@v4
with:
name: mecab-msvc-${{ matrix.machine }}-${{ steps.mecab.outputs.version }}.zip
path: dist/mecab-msvc-${{ matrix.machine }}-${{ steps.mecab.outputs.version }}.zip
- uses: actions/upload-artifact@v4
with:
name: python-wheel-${{ matrix.machine }}
path: |
dist/mecab-msvc-*.zip
dist/scripts/*.whl
- name: Upload Release Assets
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: |
dist/mecab-msvc-*.zip
dist/scripts/*.whl
if: github.event_name == 'release'
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: |
dist/mecab-msvc-*.zip
dist/scripts/*.whl
if: github.event_name == 'release'