-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (73 loc) · 2 KB
/
Copy pathrelease.yml
File metadata and controls
78 lines (73 loc) · 2 KB
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
name: release
on:
push:
tags:
- "[0-9]*.[0-9]*.[0-9]*"
- "v[0-9]*.[0-9]*.[0-9]*"
jobs:
build_source_gem:
name: Build source gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- run: bundle exec rake build
- name: Upload source gem
uses: actions/upload-artifact@v7.0.0
with:
name: source-gem
path: pkg/*.gem
retention-days: 1
build_native_gems:
name: Build native gem (${{ matrix.platform }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- x86_64-linux
- aarch64-linux
- x86_64-darwin
- arm64-darwin
steps:
- uses: actions/checkout@v6.0.2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Build native gems
run: bundle exec rb-sys-dock --platform ${{ matrix.platform }} --build
- name: Upload native gems
uses: actions/upload-artifact@v7.0.0
with:
name: native-gem-${{ matrix.platform }}
path: pkg/*-${{ matrix.platform }}.gem
retention-days: 1
release:
name: Create GitHub Release
needs:
- build_source_gem
- build_native_gems
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Extract version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "GEM_VERSION=$VERSION" >> $GITHUB_ENV
- name: Download all artifacts
uses: actions/download-artifact@v8.0.1
with:
path: artifacts
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: libfacedetection ${{ env.GEM_VERSION }}
files: artifacts/**/*.gem
generate_release_notes: true