1.10.0 #14
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-release | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: adopt | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v3 | |
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 Artifacts | |
run: | | |
for f in target/*.zip; do gh release upload ${APP_TAG} --clobber $f; done | |
gh release upload ${APP_TAG} --clobber target/openapi.json | |
gh release upload ${APP_TAG} --clobber src/main/resources/validation-rule.schema.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: mvn docker | |
run: >- | |
mvn clean package -P docker | |
--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: docker | |
run: >- | |
echo "${APP_PACKAGES_PASSWORD}" | | |
docker login "${APP_PACKAGES_URL}" | |
--username "${APP_PACKAGES_USERNAME}" | |
--password-stdin; | |
docker build . | |
--file ./Dockerfile | |
--tag "${APP_PACKAGES_URL}:latest" | |
--tag "${APP_PACKAGES_URL}:${APP_VERSION}"; | |
docker push "${APP_PACKAGES_URL}:latest"; | |
docker push "${APP_PACKAGES_URL}:${APP_VERSION}"; | |
env: | |
APP_PACKAGES_URL: ghcr.io/worldhealthorganization/ddcc-gateway/ddcc-gateway | |
APP_PACKAGES_USERNAME: ${{ github.actor }} | |
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} |