idl_update #92
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 Repository | |
run: | | |
git config --global user.email "bot@xhpolaris.com" | |
git config --global user.name "${{ github.actor }}" | |
git worktree add repo ${{ github.event.client_payload.ref }} || \ | |
(git checkout --orphan ${{ github.event.client_payload.ref }} && rm -rf "!(.git|LICENSE)" && \ | |
git add LICENSE && git commit -m "feat: init" && git checkout -f meta && \ | |
git worktree add repo ${{ github.event.client_payload.ref }}) | |
- name: Setup protoc | |
uses: arduino/setup-protoc@v1 | |
- name: Install Protobuf Compiler | |
uses: JacobSMoller/setup-protoc-grpc-java@v0.0.1 | |
- name: Update | |
run: | | |
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: 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: Maven a jar | |
run: | | |
mvn clean deploy | |
- name: Commit And Push | |
run: | | |
cd repo | |
git add . | |
git commit -m "${{ github.event.client_payload.commit_msg }}" | |
git push origin ${{ github.event.client_payload.ref }} | |
git push origin meta:meta |