Deploy #30
Workflow file for this run
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: Deploy | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
deploy_pre_release: | |
name: Deploy OpenAPI Generator Client Pre-Release to Maven | |
if: ${{ github.event.release.prerelease && github.event.release.target_commitish == 'feature/openapi-generator-sdk' }} | |
runs-on: ubuntu-latest | |
env: | |
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | |
BW_USERNAME: ${{ secrets.BW_USERNAME }} | |
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | |
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }} | |
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }} | |
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | |
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | |
BW_NUMBER: ${{ secrets.BW_NUMBER }} | |
USER_NUMBER: ${{ secrets.USER_NUMBER }} | |
VZW_NUMBER: ${{ secrets.VZW_NUMBER }} | |
ATT_NUMBER: ${{ secrets.ATT_NUMBER }} | |
T_MOBILE_NUMBER: ${{ secrets.T_MOBILE_NUMBER }} | |
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
OPERATING_SYSTEM: ${{ matrix.os }} | |
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }} | |
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }} | |
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }} | |
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }} | |
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }} | |
steps: | |
- name: Set Release Version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Check Release Tag Format | |
run: | | |
re=[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+ | |
if ! [[ $RELEASE_VERSION =~ $re ]]; then | |
echo 'Tag does not match expected regex pattern for beta releases (v[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+)' | |
echo $RELEASE_VERSION | |
echo 'Please update your tag to match the expected regex pattern' | |
exit 1 | |
fi | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: feature/openapi-generator-sdk | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_CENTRAL_TOKEN | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Set Maven Project Version | |
run: mvn versions:set -DnewVersion=$RELEASE_VERSION | |
- name: Publish to Apache Maven Central | |
run: mvn deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- uses: Bandwidth/build-notify-slack-action@v1.0.0 | |
if: always() | |
with: | |
job-status: ${{ job.status }} | |
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
slack-channel: ${{ secrets.SLACK_CHANNEL }} | |
publish: | |
if: ${{ !github.event.release.prerelease }} | |
env: | |
# Integration test environment variables. | |
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} | |
BW_PASSWORD: ${{ secrets.BW_PASSWORD }} | |
BW_USERNAME: ${{ secrets.BW_USERNAME }} | |
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }} | |
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }} | |
BW_NUMBER: ${{ secrets.BW_NUMBER }} | |
USER_NUMBER: ${{ secrets.USER_NUMBER }} | |
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Apache Maven Central | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_CENTRAL_TOKEN | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Get Maven Project Version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV | |
- name: Set Maven Project Version | |
run: mvn versions:set -DnewVersion=$RELEASE_VERSION | |
- name: Publish to Apache Maven Central | |
run: mvn deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Notify Slack | |
uses: Bandwidth/build-notify-slack-action@v1.0.0 | |
if: always() | |
with: | |
job-status: ${{ job.status }} | |
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
slack-channel: ${{ secrets.SLACK_CHANNEL }} |