0.7.0 #6
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: ci-openapi | |
on: | |
workflow_dispatch: | |
release: | |
types: | |
- created | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.m2/repository | |
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | |
- name: version | |
run: >- | |
APP_SHA=$(git rev-parse --short ${GITHUB_SHA}); | |
APP_TAG=${GITHUB_REF/refs\/tags\/} | |
APP_VERSION=${APP_TAG}; | |
echo "APP_SHA=${APP_SHA}" >> ${GITHUB_ENV}; | |
echo "APP_TAG=${APP_TAG}" >> ${GITHUB_ENV}; | |
echo "APP_VERSION=${APP_VERSION}" >> ${GITHUB_ENV}; | |
- name: mvn | |
run: >- | |
mvn versions:set | |
--batch-mode | |
--file ./pom.xml | |
--settings ./settings.xml | |
--define newVersion="${APP_VERSION}"; | |
mvn clean verify | |
--batch-mode | |
--file ./pom.xml | |
--settings ./settings.xml | |
--define app.packages.username="${APP_PACKAGES_USERNAME}" | |
--define app.packages.password="${APP_PACKAGES_PASSWORD}"; | |
env: | |
APP_PACKAGES_USERNAME: ${{ github.actor }} | |
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: openapi.json | |
path: target/openapi.json | |
- name: Checkout OpenApi Doc Branch | |
uses: actions/checkout@v2 | |
with: | |
ref: openapi-doc | |
- name: Delete existing openapi.json | |
run: rm -f openapi.json | |
- name: Download openapi.json | |
uses: actions/download-artifact@v2 | |
with: | |
name: openapi.json | |
- name: Commit and Push changes | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -a --allow-empty -m "Update OpenAPI JSON" | |
git push |