idl_update #158
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
name: Update | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
on: | |
repository_dispatch: | |
types: [ idl_update ] | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout Meta | |
uses: actions/checkout@v3 | |
with: | |
ref: meta | |
- name: Checkout IDL | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.event.client_payload.repository }} | |
ref: ${{ github.event.client_payload.ref }} | |
path: service-idl | |
token: ${{ secrets.ACCESS_TOKEN }} | |
- name: Cache Maven dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.m2/repository | |
key: maven-dependencies | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v1 | |
- name: Install Protobuf Compiler | |
uses: JacobSMoller/setup-protoc-grpc-java@v0.0.1 | |
- name: Update | |
run: | | |
git config --global user.email "bot@xhpolaris.com" | |
git config --global user.name "${{ github.actor }}" | |
curl -s https://raw.githubusercontent.com/xh-polaris/chore/main/bump_pom_version.sh | bash -s -- | |
git add pom.xml | |
git commit -m "${{ github.event.client_payload.commit_msg }}" | |
export IDL_DIR=./service-idl | |
bash build.sh | |
- name: Set up JDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Maven a jar | |
run: | | |
mvn clean deploy | |
- name: Upload artifact | |
uses: TencentCloud/cos-action@v1 | |
with: | |
secret_id: ${{ secrets.SECRET_ID }} | |
secret_key: ${{ secrets.SECRET_KEY }} | |
cos_bucket: maven-1308722423 | |
cos_region: ap-shanghai | |
local_path: repo | |
- name: Push meta branch | |
run: | | |
git push origin meta:meta |