-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58929c7
commit 6bf1796
Showing
1 changed file
with
32 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,108 +6,66 @@ on: | |
- created | ||
|
||
jobs: | ||
linux: | ||
name: linux@amd64 | ||
runs-on: ubuntu-latest | ||
build: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
config: | ||
- name: linux@amd64 | ||
os: ubuntu-latest | ||
platform: linux | ||
- name: macos@amd64 | ||
os: macos-latest | ||
platform: darwin | ||
|
||
runs-on: ${{ matrix.config.os }} | ||
name: ${{ matrix.config.name }} | ||
steps: | ||
- name: Get release | ||
- uses: actions/github-script@v7 | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: grpc/grpc | ||
ref: ${{ steps.get_release.outputs.tag_name }} | ||
|
||
- name: Install Basilisk | ||
run: | | ||
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-linux-amd64 | ||
chmod a+x bazelisk-linux-amd64 | ||
sudo mv bazelisk-linux-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_name }} | ||
run: | | ||
cd bazel-bin/src/compiler/ | ||
cp grpc_php_plugin grpc-php-plugin | ||
tar czf grpc-php-plugin.${VERSION}.linux.amd64.tar.gz grpc-php-plugin | ||
cp grpc_python_plugin grpc-python-plugin | ||
tar czf grpc-python-plugin.${VERSION}.linux.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_name }}.linux.amd64.tar.gz | ||
asset_name: grpc-php-plugin.${{ steps.get_release.outputs.tag_name }}.linux.amd64.tar.gz | ||
asset_content_type: application/gzip | ||
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 }); | ||
- 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_name }}.linux.amd64.tar.gz | ||
asset_name: grpc-python-plugin.${{ steps.get_release.outputs.tag_name }}.linux.amd64.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
macos: | ||
name: macos@amd64 | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- name: Get release | ||
id: get_release | ||
uses: bruceadams/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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 }} | ||
ref: ${{ steps.get_release.outputs.tag }} | ||
|
||
- name: Install Basilisk | ||
run: | | ||
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-darwin-amd64 | ||
chmod a+x bazelisk-darwin-amd64 | ||
sudo mv bazelisk-darwin-amd64 /usr/local/bin/bazel | ||
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_python_plugin | ||
- 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_name }} | ||
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}.darwin.amd64.tar.gz 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}.darwin.amd64.tar.gz 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_name }}.darwin.amd64.tar.gz | ||
asset_name: grpc-php-plugin.${{ steps.get_release.outputs.tag_name }}.darwin.amd64.tar.gz | ||
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 | ||
|
@@ -116,6 +74,6 @@ jobs: | |
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_name }}.darwin.amd64.tar.gz | ||
asset_name: grpc-python-plugin.${{ steps.get_release.outputs.tag_name }}.darwin.amd64.tar.gz | ||
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 |