|
6 | 6 | - created |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - linux: |
10 | | - name: linux@amd64 |
11 | | - runs-on: ubuntu-latest |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + fail-fast: true |
| 12 | + matrix: |
| 13 | + config: |
| 14 | + - name: linux@amd64 |
| 15 | + os: ubuntu-latest |
| 16 | + platform: linux |
| 17 | + - name: macos@amd64 |
| 18 | + os: macos-latest |
| 19 | + platform: darwin |
12 | 20 |
|
| 21 | + runs-on: ${{ matrix.config.os }} |
| 22 | + name: ${{ matrix.config.name }} |
13 | 23 | steps: |
14 | | - - name: Get release |
| 24 | + - uses: actions/github-script@v7 |
15 | 25 | id: get_release |
16 | | - uses: bruceadams/[email protected] |
17 | | - env: |
18 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
19 | | - |
20 | | - - name: Checkout |
21 | | - uses: actions/checkout@v2 |
22 | | - with: |
23 | | - repository: grpc/grpc |
24 | | - ref: ${{ steps.get_release.outputs.tag_name }} |
25 | | - |
26 | | - - name: Install Basilisk |
27 | | - run: | |
28 | | - wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-linux-amd64 |
29 | | - chmod a+x bazelisk-linux-amd64 |
30 | | - sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel |
31 | | -
|
32 | | - - name: Build grpc_php_plugin and grpc_pyhon_plugin |
33 | | - run: | |
34 | | - bazel build src/compiler:grpc_php_plugin |
35 | | - bazel build src/compiler:grpc_python_plugin |
36 | | - - name: Archive artifacts |
37 | | - env: |
38 | | - VERSION: ${{ steps.get_release.outputs.tag_name }} |
39 | | - run: | |
40 | | - cd bazel-bin/src/compiler/ |
41 | | - cp grpc_php_plugin grpc-php-plugin |
42 | | - tar czf grpc-php-plugin.${VERSION}.linux.amd64.tar.gz grpc-php-plugin |
43 | | - cp grpc_python_plugin grpc-python-plugin |
44 | | - tar czf grpc-python-plugin.${VERSION}.linux.amd64.tar.gz grpc-python-plugin |
45 | | -
|
46 | | - - name: Upload Release Asset for grpc_php_plugin |
47 | | - uses: actions/upload-release-asset@v1 |
48 | | - env: |
49 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
50 | 26 | with: |
51 | | - upload_url: ${{ steps.get_release.outputs.upload_url }} |
52 | | - asset_path: bazel-bin/src/compiler/grpc-php-plugin.${{ steps.get_release.outputs.tag_name }}.linux.amd64.tar.gz |
53 | | - asset_name: grpc-php-plugin.${{ steps.get_release.outputs.tag_name }}.linux.amd64.tar.gz |
54 | | - asset_content_type: application/gzip |
| 27 | + script: | |
| 28 | + const tag = context.ref.replace('refs/tags/', ''); |
| 29 | + const { owner, repo } = context.repo; |
| 30 | + const { data: { upload_url } } = await github.rest.repos.getReleaseByTag({ owner, repo, tag }); |
55 | 31 |
|
56 | | - - name: Upload Release Asset for grpc_python_plugin |
57 | | - uses: actions/upload-release-asset@v1 |
58 | | - env: |
59 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
60 | | - with: |
61 | | - upload_url: ${{ steps.get_release.outputs.upload_url }} |
62 | | - asset_path: bazel-bin/src/compiler/grpc-python-plugin.${{ steps.get_release.outputs.tag_name }}.linux.amd64.tar.gz |
63 | | - asset_name: grpc-python-plugin.${{ steps.get_release.outputs.tag_name }}.linux.amd64.tar.gz |
64 | | - asset_content_type: application/gzip |
65 | | - |
66 | | - macos: |
67 | | - name: macos@amd64 |
68 | | - runs-on: macos-latest |
69 | | - |
70 | | - steps: |
71 | | - - name: Get release |
72 | | - id: get_release |
73 | | - uses: bruceadams/[email protected] |
74 | | - env: |
75 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + core.setOutput('upload_url', upload_url); |
| 33 | + core.setOutput('tag', tag); |
76 | 34 |
|
77 | 35 | - name: Checkout |
78 | 36 | uses: actions/checkout@v2 |
79 | 37 | with: |
80 | 38 | repository: grpc/grpc |
81 | | - ref: ${{ steps.get_release.outputs.tag_name }} |
| 39 | + ref: ${{ steps.get_release.outputs.tag }} |
82 | 40 |
|
83 | 41 | - name: Install Basilisk |
84 | 42 | run: | |
85 | | - wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-darwin-amd64 |
86 | | - chmod a+x bazelisk-darwin-amd64 |
87 | | - sudo mv bazelisk-darwin-amd64 /usr/local/bin/bazel |
| 43 | + wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-${{ matrix.config.platform }}-amd64 |
| 44 | + chmod a+x bazelisk-${{ matrix.config.platform }}-amd64 |
| 45 | + sudo mv bazelisk-${{ matrix.config.platform }}-amd64 /usr/local/bin/bazel |
88 | 46 |
|
89 | | - - name: Build grpc_php_plugin and grpc_python_plugin |
| 47 | + - name: Build grpc_php_plugin and grpc_pyhon_plugin |
90 | 48 | run: | |
91 | 49 | bazel build src/compiler:grpc_php_plugin |
92 | 50 | bazel build src/compiler:grpc_python_plugin |
93 | 51 | - name: Archive artifacts |
94 | 52 | env: |
95 | | - VERSION: ${{ steps.get_release.outputs.tag_name }} |
| 53 | + VERSION: ${{ steps.get_release.outputs.tag }} |
96 | 54 | run: | |
97 | 55 | cd bazel-bin/src/compiler/ |
98 | 56 | cp grpc_php_plugin grpc-php-plugin |
99 | | - tar czf grpc-php-plugin.${VERSION}.darwin.amd64.tar.gz grpc-php-plugin |
| 57 | + tar czf grpc-php-plugin.${VERSION}.${{ matrix.config.platform }}.amd64.tar.gz grpc-php-plugin |
100 | 58 | cp grpc_python_plugin grpc-python-plugin |
101 | | - tar czf grpc-python-plugin.${VERSION}.darwin.amd64.tar.gz grpc-python-plugin |
| 59 | + tar czf grpc-python-plugin.${VERSION}.${{ matrix.config.platform }}.amd64.tar.gz grpc-python-plugin |
102 | 60 |
|
103 | 61 | - name: Upload Release Asset for grpc_php_plugin |
104 | 62 | uses: actions/upload-release-asset@v1 |
105 | 63 | env: |
106 | 64 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
107 | 65 | with: |
108 | 66 | upload_url: ${{ steps.get_release.outputs.upload_url }} |
109 | | - asset_path: bazel-bin/src/compiler/grpc-php-plugin.${{ steps.get_release.outputs.tag_name }}.darwin.amd64.tar.gz |
110 | | - asset_name: grpc-php-plugin.${{ steps.get_release.outputs.tag_name }}.darwin.amd64.tar.gz |
| 67 | + asset_path: bazel-bin/src/compiler/grpc-php-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz |
| 68 | + asset_name: grpc-php-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz |
111 | 69 | asset_content_type: application/gzip |
112 | 70 |
|
113 | 71 | - name: Upload Release Asset for grpc_python_plugin |
|
116 | 74 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
117 | 75 | with: |
118 | 76 | upload_url: ${{ steps.get_release.outputs.upload_url }} |
119 | | - asset_path: bazel-bin/src/compiler/grpc-python-plugin.${{ steps.get_release.outputs.tag_name }}.darwin.amd64.tar.gz |
120 | | - asset_name: grpc-python-plugin.${{ steps.get_release.outputs.tag_name }}.darwin.amd64.tar.gz |
| 77 | + asset_path: bazel-bin/src/compiler/grpc-python-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz |
| 78 | + asset_name: grpc-python-plugin.${{ steps.get_release.outputs.tag }}.${{ matrix.config.platform }}.amd64.tar.gz |
121 | 79 | asset_content_type: application/gzip |
0 commit comments