Deploy #28
This file contains hidden or 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
| # | |
| # Copyright 2018 ABSA Group Limited | |
| # | |
| # Licensed 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: Deploy | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-tags: true | |
| fetch-depth: 0 # Fetch all history for all tags and branches | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: '1.8' | |
| - name: Import GPG keys | |
| run: | | |
| mkdir -p ~/.gnupg | |
| chmod 700 ~/.gnupg | |
| # Configure GPG for CI | |
| echo "use-agent" >> ~/.gnupg/gpg.conf | |
| echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf | |
| echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf | |
| # Import the private key | |
| echo "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --import | |
| # Extract and trust the fingerprint | |
| FINGERPRINT=$(gpg --with-colons --list-secret-keys | awk -F: '/^fpr:/ { print $10; exit }') | |
| echo "$FINGERPRINT:6:" | gpg --import-ownertrust | |
| # Set permissions | |
| chmod 600 ~/.gnupg/* | |
| chmod 700 ~/.gnupg | |
| # Restart GPG agent | |
| gpgconf --kill gpg-agent | |
| echo RELOADAGENT | gpg-connect-agent | |
| - name: Create settings.xml | |
| run: | | |
| echo "<settings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd\"> | |
| <servers> | |
| <server> | |
| <id>ossrh</id> | |
| <username>${{ secrets.OSSRH_USERNAME }}</username> | |
| <password>${{ secrets.OSSRH_TOKEN }}</password> | |
| </server> | |
| </servers> | |
| </settings>" > $HOME/.m2/settings.xml | |
| - name: Build and deploy artifact | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| GPG_TTY: /dev/console | |
| run: | | |
| mvn scala-cross-build:change-version -Pscala-2.11,spark-2 | |
| mvn -B -e -DskipTests -Dmanual-release -Pdeploy,scala-2.11,spark-2 -Dossrh clean deploy -Dossrh.username=${{ secrets.OSSRH_USERNAME }} -Dossrh.password=${{ secrets.OSSRH_TOKEN }} -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
| # mvn scala-cross-build:restore-version | |
| # git clean -f | |
| # - name: Build and deploy artifact | |
| # env: | |
| # MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| # MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| # GPG_TTY: $(tty) | |
| # run: | | |
| # mvn scala-cross-build:change-version -Pscala-${{ matrix.scala }},spark-${{ matrix.spark }} | |
| # mvn -B -e -DskipTests -Dmanual-release -Pdeploy,scala-${{ matrix.scala }},spark-${{ matrix.spark }} -Dossrh clean deploy -Dossrh.username=${{ secrets.OSSRH_USERNAME }} -Dossrh.password=${{ secrets.OSSRH_TOKEN }} -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} |