-
Notifications
You must be signed in to change notification settings - Fork 1.5k
GH-3547: Add semi-automated release pipeline for Apache Parquet Java #3548
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
base: master
Are you sure you want to change the base?
Changes from all commits
81d2bdd
4ebedf3
7eb3b2c
1524fe4
4d52d06
7dbabbf
a7f8d72
4356ea1
2b898b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| name: Test Release Scripts | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'release/**' | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| - 'release/**' | ||
|
|
||
| jobs: | ||
| bats: | ||
| name: Release Script Unit Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install bats-core | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y bats | ||
| - name: Configure Git identity for tests | ||
| run: | | ||
| git config --global user.name "CI" | ||
| git config --global user.email "ci@test" | ||
| - name: Run bats tests | ||
| run: bats release/tests/*.bats | ||
|
|
||
| - name: Verify scripts are executable | ||
| run: | | ||
| for script in release/bin/*.sh; do | ||
| if [[ ! -x "$script" ]]; then | ||
| echo "ERROR: $script is not executable" | ||
| exit 1 | ||
| fi | ||
| done | ||
| echo "All scripts are executable" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| name: Release - Cancel RC | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Release version (e.g., 1.18.0)' | ||
| required: true | ||
| type: string | ||
| rc_number: | ||
| description: 'RC number to cancel (e.g., 0)' | ||
| required: true | ||
| type: string | ||
| staging_repo_id: | ||
| description: 'Nexus staging repository ID to drop (e.g., orgapacheparquet-1234)' | ||
| required: true | ||
| type: string | ||
| allow_description_mismatch: | ||
| description: 'Bypass the staging-repo description check (recovery only)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| dry_run: | ||
| description: 'Dry run mode (no actual changes)' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
|
|
||
| jobs: | ||
| cancel-rc: | ||
| if: github.repository_owner == 'apache' | ||
| name: Cancel Release Candidate | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Parquet isn't using zimor yet, but in the future we should switch this and all other actions to hard coded sha's |
||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
|
|
||
| - name: Install Subversion | ||
| run: sudo apt-get update && sudo apt-get install -y subversion | ||
|
|
||
| - name: Cancel Release Candidate | ||
| env: | ||
| DRY_RUN: ${{ inputs.dry_run && '1' || '0' }} | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. anything in "secrets" is automatically redacted by Github Actions so we don't have to worry about any of this stuff being exposed |
||
| NEXUS_USERNAME: ${{ secrets.PARQUET_NEXUS_USER }} | ||
| NEXUS_PASSWORD: ${{ secrets.PARQUET_NEXUS_PASSWORD }} | ||
| SVN_USERNAME: ${{ secrets.PARQUET_SVN_DEV_USERNAME }} | ||
| SVN_PASSWORD: ${{ secrets.PARQUET_SVN_DEV_PASSWORD }} | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| INPUT_RC_NUMBER: ${{ inputs.rc_number }} | ||
| INPUT_STAGING_REPO_ID: ${{ inputs.staging_repo_id }} | ||
| INPUT_ALLOW_DESCRIPTION_MISMATCH: ${{ inputs.allow_description_mismatch && '1' || '0' }} | ||
| run: | | ||
| args=("${INPUT_VERSION}" "${INPUT_RC_NUMBER}" "${INPUT_STAGING_REPO_ID}") | ||
| if [[ "${INPUT_ALLOW_DESCRIPTION_MISMATCH}" == "1" ]]; then | ||
| args+=(--allow-description-mismatch) | ||
| fi | ||
| ./release/bin/cancel-rc.sh "${args[@]}" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| name: Release - Prepare RC | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Release version (e.g., 1.18.0)' | ||
| required: true | ||
| type: string | ||
| rc_number: | ||
| description: 'RC number override (leave empty for auto-detect)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| dry_run: | ||
| description: 'Dry run mode (no actual changes)' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
|
|
||
| jobs: | ||
| prepare-rc: | ||
| if: github.repository_owner == 'apache' | ||
| name: Prepare Release Candidate | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '11' | ||
|
|
||
| - name: Import GPG key and configure Git | ||
| env: | ||
| GPG_PRIVATE_KEY: ${{ secrets.PARQUET_GPG_PRIVATE_KEY }} | ||
| run: | | ||
| echo "${GPG_PRIVATE_KEY}" | gpg --batch --import | ||
| KEY_ID=$(gpg --list-keys --with-colons | grep '^fpr' | head -1 | cut -d: -f10) | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --global user.signingkey "${KEY_ID}" | ||
| git config --global commit.gpgsign true | ||
|
|
||
| - name: Install Subversion | ||
| run: sudo apt-get update && sudo apt-get install -y subversion | ||
|
|
||
| - name: Prepare Release Candidate | ||
| env: | ||
| DRY_RUN: ${{ inputs.dry_run && '1' || '0' }} | ||
| NEXUS_USERNAME: ${{ secrets.PARQUET_NEXUS_USER }} | ||
| NEXUS_PASSWORD: ${{ secrets.PARQUET_NEXUS_PASSWORD }} | ||
| SVN_USERNAME: ${{ secrets.PARQUET_SVN_DEV_USERNAME }} | ||
| SVN_PASSWORD: ${{ secrets.PARQUET_SVN_DEV_PASSWORD }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| INPUT_RC_NUMBER: ${{ inputs.rc_number }} | ||
| run: | | ||
| args=("${INPUT_VERSION}") | ||
| if [[ -n "${INPUT_RC_NUMBER}" ]]; then | ||
| args+=(--rc "${INPUT_RC_NUMBER}") | ||
| fi | ||
| ./release/bin/prepare-rc.sh "${args[@]}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| name: Release - Publish After Vote | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Release version (e.g., 1.18.0)' | ||
| required: true | ||
| type: string | ||
| rc_number: | ||
| description: 'RC number that passed the vote (leave empty to auto-detect latest)' | ||
| required: false | ||
| type: string | ||
| default: '' | ||
| staging_repo_id: | ||
| description: 'Nexus staging repository ID (e.g., orgapacheparquet-1234)' | ||
| required: true | ||
| type: string | ||
| allow_description_mismatch: | ||
| description: 'Bypass the staging-repo description check (recovery only)' | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| dry_run: | ||
| description: 'Dry run mode (no actual changes)' | ||
| required: false | ||
| type: boolean | ||
| default: true | ||
|
|
||
| jobs: | ||
| publish-release: | ||
| if: github.repository_owner == 'apache' | ||
| name: Publish Release | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Set up JDK 11 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '11' | ||
|
|
||
| - name: Install Subversion | ||
| run: sudo apt-get update && sudo apt-get install -y subversion | ||
|
|
||
| - name: Configure Git | ||
| run: | | ||
| git config --global user.name "github-actions[bot]" | ||
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
|
|
||
| - name: Publish Release | ||
| env: | ||
| DRY_RUN: ${{ inputs.dry_run && '1' || '0' }} | ||
| NEXUS_USERNAME: ${{ secrets.PARQUET_NEXUS_USER }} | ||
| NEXUS_PASSWORD: ${{ secrets.PARQUET_NEXUS_PASSWORD }} | ||
| SVN_USERNAME: ${{ secrets.PARQUET_SVN_DEV_USERNAME }} | ||
| SVN_PASSWORD: ${{ secrets.PARQUET_SVN_DEV_PASSWORD }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
| INPUT_RC_NUMBER: ${{ inputs.rc_number }} | ||
| INPUT_STAGING_REPO_ID: ${{ inputs.staging_repo_id }} | ||
| INPUT_ALLOW_DESCRIPTION_MISMATCH: ${{ inputs.allow_description_mismatch && '1' || '0' }} | ||
| run: | | ||
| args=("${INPUT_VERSION}" "${INPUT_STAGING_REPO_ID}") | ||
| if [[ -n "${INPUT_RC_NUMBER}" ]]; then | ||
| args+=(--rc "${INPUT_RC_NUMBER}") | ||
| fi | ||
| if [[ "${INPUT_ALLOW_DESCRIPTION_MISMATCH}" == "1" ]]; then | ||
| args+=(--allow-description-mismatch) | ||
| fi | ||
| ./release/bin/publish-release.sh "${args[@]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can rip out all of these tests if folks don't find them useful, it's just a bunch of Bash Unit Testing to try to make sure at least our helper functions do what they are supposed to. They use mocked output though so they have limited utility for testing the real true pathway.