Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(parsers): split parsers and back to sbt build def #401

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
component:
- utils
- client
- snapi-parser
- sql-parser
- snapi-frontend
- snapi-truffle
- snapi-client
Expand Down
108 changes: 27 additions & 81 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ jobs:
with:
ref: ${{ github.event.client_payload.pull_request.head.sha }}
fetch-depth: 0
- if: github.event_name != 'repository_dispatch'
name: build all
run: ./rebuild.sh --release
- if: github.event_name == 'repository_dispatch'
name: build all
- name: build all
run: ./rebuild.sh
- name: sbt ci-release utils
run: ./release.sh
Expand All @@ -58,6 +54,28 @@ jobs:
CI_CLEAN: clean
CI_RELEASE: publishSigned
CI_SNAPSHOT_RELEASE: publish
- name: sbt ci-release snapi-parser
run: ./release.sh
working-directory: snapi-parser
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
CI_CLEAN: clean
CI_RELEASE: publishSigned
CI_SNAPSHOT_RELEASE: publish
- name: sbt ci-release sql-parser
run: ./release.sh
working-directory: sql-parser
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
CI_CLEAN: clean
CI_RELEASE: publishSigned
CI_SNAPSHOT_RELEASE: publish
- name: sbt ci-release snapi-frontend
run: ./release.sh
working-directory: snapi-frontend
Expand Down Expand Up @@ -107,6 +125,8 @@ jobs:
run: |
echo "UTILS_VER=$(cat utils/version)" >> $GITHUB_ENV
echo "CLIENT_VER=$(cat client/version)" >> $GITHUB_ENV
echo "SNAPI_PARSER_VER=$(cat snapi-parser/version)" >> $GITHUB_ENV
echo "SQL_PARSER_VER=$(cat sql-parser/version)" >> $GITHUB_ENV
echo "SNAPI_FRONTEND_VER=$(cat snapi-frontend/version)" >> $GITHUB_ENV
echo "SNAPI_TRUFFLE_VER=$(cat snapi-truffle/version)" >> $GITHUB_ENV
echo "SNAPI_CLIENT=$(cat snapi-client/version)" >> $GITHUB_ENV
Expand All @@ -120,6 +140,8 @@ jobs:
body: |
> published utils version: ${{ env.UTILS_VER }}
> published client version: ${{ env.CLIENT_VER }}
> published snapi-parser version: ${{ env.SNAPI_PARSER_VER }}
> published sql-parser version: ${{ env.SQL_PARSER_VER }}
> published snapi-frontend version: ${{ env.SNAPI_FRONTEND_VER }}
> published snapi-truffle version: ${{ env.SNAPI_TRUFFLE_VER }}
> published snapi-client version: ${{ env.SNAPI_CLIENT }}
Expand All @@ -141,79 +163,3 @@ jobs:
> something went wrong with `publish-snapi-components`
> run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) failed :x:
reactions: confused

publish-parsers:
runs-on: self-hosted
steps:
- if: github.event_name != 'repository_dispatch'
name: checkout caller ref
uses: actions/checkout@v4
with:
fetch-depth: 0
- if: github.event_name == 'repository_dispatch'
name: checkout for PR comment
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.pull_request.head.sha }}
fetch-depth: 0
- name: sdkman java install
id: sdkman
shell: bash
run: |
export SDKMAN_DIR="$HOME/.sdkman"
[ ! -f "$SDKMAN_DIR/bin/sdkman-init.sh" ] && curl -s "https://get.sdkman.io?rcupdate=false" | bash
source $HOME/.sdkman/bin/sdkman-init.sh
yes n | sdk install java 21.0.1-graalce || true
sdk use java 21.0.1-graalce
echo "$SDKMAN_DIR/candidates/java/current/bin" >> $GITHUB_PATH
- uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.6
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PGP_SECRET }}
passphrase: ${{ secrets.PGP_PASSPHRASE }}
- uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "ossrh",
"username": "${{ secrets.SONATYPE_TOKEN_USER }}",
"password": "${{ secrets.SONATYPE_TOKEN }}"
}]
properties: |
[{
"key": "gpg.keyname",
"value": "${{ secrets.GPG_KEYNAME }}"
}]
- if: github.event_name == 'repository_dispatch'
name: publish to snapshots repo
working-directory: parsers
run: |
./publish.sh
echo SNAPI_PARSER_VER="$(cat version)" >> $GITHUB_ENV
- if: github.event_name != 'repository_dispatch'
name: release
working-directory: parsers
run: |
./release.sh
echo SNAPI_PARSER_VER="$(cat version)" >> $GITHUB_ENV
- if: github.event_name == 'repository_dispatch'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.RAW_CI_PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
body: |
> published parsers version: ${{ env.SNAPI_PARSER_VER }}
reactions: rocket
- if: failure() && github.event_name == 'repository_dispatch'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.RAW_CI_PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
body: |
> something went wrong with `publish-parsers`
> run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) :x:
reactions: confused
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ snapi-client/version
sql-client/version
snapi-frontend/version
snapi-truffle/version
parsers/version
sql-parser/version
snapi-parser/version
python-client/version
parsers/src/main/java/raw/compiler/rql2/generated
parsers/src/main/java/raw/client/sql/generated

snapi-parser/src/main/java/raw/compiler/rql2/generated
sql-parser/src/main/java/raw/client/sql/generated

**/pom.xml.versionsBackup

23 changes: 0 additions & 23 deletions parsers/build.sh

This file was deleted.

186 changes: 0 additions & 186 deletions parsers/pom.xml

This file was deleted.

13 changes: 0 additions & 13 deletions parsers/publish.sh

This file was deleted.

Loading
Loading