-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (70 loc) · 2.98 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
name: Build Artifacts
on:
release:
types:
- created
jobs:
build:
strategy:
fail-fast: true
matrix:
config:
- name: linux@amd64
os: ubuntu-latest
platform: linux
- name: macos@amd64
os: macos-13
platform: darwin
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
steps:
- uses: actions/github-script@v7
id: get_release
with:
script: |
const tag = context.ref.replace('refs/tags/', '');
const { owner, repo } = context.repo;
const { data: { upload_url } } = await github.rest.repos.getReleaseByTag({ owner, repo, tag });
core.setOutput('upload_url', upload_url);
core.setOutput('tag', tag);
- name: Checkout
uses: actions/checkout@v2
with:
repository: grpc/grpc
ref: ${{ steps.get_release.outputs.tag }}
- name: Install Basilisk
run: |
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-${{ matrix.config.platform }}-amd64
chmod a+x bazelisk-${{ matrix.config.platform }}-amd64
sudo mv bazelisk-${{ matrix.config.platform }}-amd64 /usr/local/bin/bazel
- name: Build grpc_php_plugin and grpc_pyhon_plugin
run: |
bazel build src/compiler:grpc_php_plugin
bazel build src/compiler:grpc_python_plugin
- name: Archive artifacts
env:
VERSION: ${{ steps.get_release.outputs.tag }}
run: |
cd bazel-bin/src/compiler/
cp grpc_php_plugin grpc-php-plugin
tar czf grpc-php-plugin.${VERSION}.${{ matrix.config.platform }}.amd64.tar.gz grpc-php-plugin
cp grpc_python_plugin grpc-python-plugin
tar czf grpc-python-plugin.${VERSION}.${{ matrix.config.platform }}.amd64.tar.gz grpc-python-plugin
- name: Upload Release Asset for grpc_php_plugin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: bazel-bin/src/compiler/grpc-php-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz
asset_name: grpc-php-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset for grpc_python_plugin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: bazel-bin/src/compiler/grpc-python-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz
asset_name: grpc-python-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz
asset_content_type: application/gzip