Skip to content

Commit 775d504

Browse files
committed
Merge remote-tracking branch 'origin/main' into pushdown-sort
2 parents 8ad01f7 + 21fd14c commit 775d504

File tree

10 files changed

+698
-371
lines changed

10 files changed

+698
-371
lines changed

.github/maven-publish-utils.sh

Lines changed: 410 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/enforce-labels.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Enforce PR labels
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: yogevbd/[email protected]
11+
with:
12+
REQUIRED_LABELS_ANY: "breaking,feature,enhancement,bug,infrastructure,dependencies,documentation,maintenance,skip-changelog"
13+
REQUIRED_LABELS_ANY_DESCRIPTION: "A release label is required: ['breaking', 'bug', 'dependencies', 'documentation', 'enhancement', 'feature', 'infrastructure', 'maintenance', 'skip-changelog']"
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Publish async-query-core to maven
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- 1.*
9+
- 2.*
10+
paths:
11+
- 'async-query-core/**'
12+
- '.github/workflows/publish-async-query-core.yml'
13+
- '.github/maven-publish-utils.sh'
14+
- '.github/get-sonatype-credentials.sh'
15+
16+
concurrency:
17+
group: maven-publish-async-query-core
18+
cancel-in-progress: false
19+
20+
env:
21+
SNAPSHOT_REPO_URL: https://aws.oss.sonatype.org/content/repositories/snapshots/
22+
COMMIT_MAP_FILENAME: commit-history-async-query-core.json
23+
24+
jobs:
25+
publish-async-query-core:
26+
strategy:
27+
fail-fast: false
28+
if: github.repository == 'opensearch-project/sql'
29+
runs-on: ubuntu-latest
30+
31+
permissions:
32+
id-token: write
33+
contents: write
34+
35+
steps:
36+
- uses: actions/setup-java@v3
37+
with:
38+
distribution: temurin
39+
java-version: 21
40+
41+
- uses: actions/checkout@v3
42+
43+
- uses: aws-actions/[email protected]
44+
with:
45+
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
46+
aws-region: us-east-1
47+
48+
- name: Setup publishing credentials
49+
id: creds
50+
run: |
51+
.github/get-sonatype-credentials.sh
52+
53+
- name: Set commit ID
54+
id: set_commit
55+
run: |
56+
COMMIT_ID=$(git log -1 --format='%H')
57+
echo "commit_id=${COMMIT_ID}" >> $GITHUB_OUTPUT
58+
echo "Using commit ID: ${COMMIT_ID}"
59+
60+
- name: Extract version from build.gradle
61+
id: extract_version
62+
run: |
63+
VERSION=$(grep -m 1 "archiveVersion.set" ./async-query-core/build.gradle | sed -n "s/.*archiveVersion.set('\([^']*\)').*/\1/p")
64+
65+
if [[ ! $VERSION == *-SNAPSHOT ]]; then
66+
VERSION="${VERSION}-SNAPSHOT"
67+
fi
68+
69+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
70+
echo "Version: ${VERSION}"
71+
72+
- uses: actions/checkout@v4
73+
with:
74+
repository: 'opensearch-project/opensearch-build-libraries'
75+
path: 'build'
76+
77+
- name: Install required tools
78+
run: sudo apt-get update && sudo apt-get install -y xmlstarlet jq
79+
80+
- name: Publish async-query-core
81+
run: |
82+
# Source the utility functions
83+
source ./.github/maven-publish-utils.sh
84+
85+
# Call the main function for async-query-core
86+
publish_async_query_core "${{ steps.extract_version.outputs.VERSION }}" "${{ steps.set_commit.outputs.commit_id }}"
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Publish grammar files to maven
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- 1.*
9+
- 2.*
10+
paths:
11+
- 'language-grammar/src/main/antlr4/**'
12+
- 'language-grammar/build.gradle'
13+
- '.github/workflows/publish-grammar-files.yml'
14+
- '.github/maven-publish-utils.sh'
15+
- '.github/get-sonatype-credentials.sh'
16+
17+
concurrency:
18+
group: maven-publish-language-grammar
19+
cancel-in-progress: false
20+
21+
env:
22+
SNAPSHOT_REPO_URL: https://aws.oss.sonatype.org/content/repositories/snapshots/
23+
COMMIT_MAP_FILENAME: commit-history-language-grammar.json
24+
25+
jobs:
26+
publish-grammar-files:
27+
strategy:
28+
fail-fast: false
29+
if: github.repository == 'opensearch-project/sql'
30+
runs-on: ubuntu-latest
31+
32+
permissions:
33+
id-token: write
34+
contents: write
35+
36+
env:
37+
TARGET_REPO_PATH: org/opensearch/language-grammar
38+
39+
steps:
40+
- uses: actions/setup-java@v3
41+
with:
42+
distribution: temurin
43+
java-version: 21
44+
45+
- uses: actions/checkout@v3
46+
47+
- uses: aws-actions/[email protected]
48+
with:
49+
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
50+
aws-region: us-east-1
51+
52+
- name: Setup publishing credentials
53+
id: creds
54+
run: |
55+
.github/get-sonatype-credentials.sh
56+
57+
- name: Set version
58+
id: set_version
59+
run: |
60+
VERSION=$(grep "version = " ./language-grammar/build.gradle | cut -d "'" -f 2)
61+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
62+
echo "Using version: ${VERSION}"
63+
64+
- name: Set commit ID
65+
id: set_commit
66+
run: |
67+
COMMIT_ID=$(git log -1 --format='%H')
68+
echo "commit_id=${COMMIT_ID}" >> $GITHUB_OUTPUT
69+
echo "Using commit ID: ${COMMIT_ID}"
70+
71+
- uses: actions/checkout@v4
72+
with:
73+
repository: 'opensearch-project/opensearch-build-libraries'
74+
path: 'build'
75+
76+
- name: Install required tools
77+
run: sudo apt-get update && sudo apt-get install -y xmlstarlet jq
78+
79+
- name: Publish grammar files
80+
run: |
81+
# Source the utility functions
82+
source ./.github/maven-publish-utils.sh
83+
84+
# Call the main function for grammar files
85+
publish_grammar_files "${{ steps.set_version.outputs.VERSION }}" "${{ steps.set_commit.outputs.commit_id }}"

0 commit comments

Comments
 (0)