-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (115 loc) · 3.54 KB
/
publish-couchbase.yaml
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
name: Publish couchbase package
permissions:
# This is required for uploading release artifacts.
contents: write
# This is required for authentication with pub.dev using OIDC.
id-token: write
on:
push:
tags:
- 'couchbase-v*'
workflow_dispatch:
jobs:
macOS:
strategy:
matrix:
arch: [x86_64, arm64]
runs-on: macos-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install Melos
run: dart pub global activate melos
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Install ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: release-binaries-macos-${{ matrix.arch }}
- run: melos build:OpenSSL -- --arch ${{ matrix.arch }}
- run: melos build:libCouchbaseDart
env:
CMAKE_OSX_ARCHITECTURES: ${{ matrix.arch }}
- name: Create archive
working-directory: native/build
run:
# Use GNU tar to work around a bug in Apple tar.
# https://github.com/actions/runner-images/issues/2619
gtar -czf libCouchbaseDart-macos-${{ matrix.arch }}.tar.gz
libCouchbaseDart.dylib
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: libCouchbaseDart-macos-${{ matrix.arch }}
path: native/build/libCouchbaseDart-macos-${{ matrix.arch }}.tar.gz
Linux:
strategy:
matrix:
include:
- runner: ubuntu-22.04
arch: x86_64
- runner: buildjet-8vcpu-ubuntu-2204-arm
arch: arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install Melos
run: dart pub global activate melos
- name: Install CMake
uses: lukka/get-cmake@latest
- name: Install ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: release-binaries-linux-${{ matrix.arch }}
- run: melos build:OpenSSL
- run: melos build:libCouchbaseDart
- name: Create archive
working-directory: native/build
run:
tar -czf libCouchbaseDart-linux-${{ matrix.arch }}.tar.gz
libCouchbaseDart.so
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: libCouchbaseDart-linux-${{ matrix.arch }}
path: native/build/libCouchbaseDart-linux-${{ matrix.arch }}.tar.gz
Publish:
if:
github.event_name == 'push' && startsWith(github.ref,
'refs/tags/couchbase-v')
needs: [macOS, Linux]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download all binary archives
uses: actions/download-artifact@v3
with:
path: archives
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: archives/**
- name: Install Dart
uses: dart-lang/setup-dart@v1
- name: Install dependencies
working-directory: package/couchbase
run: dart pub get
- name: Publish package
working-directory: package/couchbase
run: dart pub publish --force