Release #35
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
# This workflow: | |
# - Packages up the encoders, and publishes to Maven | |
# - Packages up the Python library, and publishes to PyPI | |
# - Builds the server Docker image, and pushes to Docker Hub | |
# - Creates a draft release | |
# | |
# This is only run when a version tag is pushed. | |
name: Release | |
on: | |
push: | |
tags: | |
- "v**" | |
env: | |
# The add-exports and add-opens flags are required for Java 17 | |
MAVEN_OPTS: --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED | |
jobs: | |
deploy-maven: | |
name: Maven Central | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
# This is required so that git-commit-id-plugin can find the latest tag. | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: "zulu" | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Install GPG key | |
run: | | |
cat <(echo -e "${{ secrets.GPG_KEY }}") | gpg --batch --import | |
gpg --list-secret-keys --keyid-format LONG | |
- name: Configure Maven settings | |
uses: s4u/maven-settings-action@v2.6.0 | |
with: | |
servers: | | |
[{ | |
"id": "ossrh", | |
"username": "${{ secrets.OSSRH_USERNAME }}", | |
"password": "${{ secrets.OSSRH_PASSWORD }}" | |
}] | |
- name: Run the deploy goal with Maven | |
run: | | |
mvn --batch-mode deploy \ | |
-pl fhir-server,library-api,library-runtime -am \ | |
-PmavenRelease,docs \ | |
-DskipTests \ | |
-Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" | |
timeout-minutes: 30 | |
deploy-python: | |
name: PyPI | |
runs-on: ubuntu-latest | |
needs: deploy-maven | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
# This is required so that git-commit-id-plugin can find the latest tag. | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: "zulu" | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Run the deploy goal with Maven | |
env: | |
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
run: | | |
mvn --batch-mode deploy \ | |
-pl lib/python -am \ | |
-PpythonRelease \ | |
-DskipTests | |
timeout-minutes: 30 | |
deploy-docker: | |
name: Docker Hub | |
runs-on: ubuntu-latest | |
needs: deploy-python | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
# This is required so that git-commit-id-plugin can find the latest tag. | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: "zulu" | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Run the deploy goal with Maven | |
run: | | |
mvn --batch-mode deploy \ | |
-pl fhir-server -am \ | |
-Pdocker \ | |
-DskipTests -DskipScalaDocs | |
timeout-minutes: 30 | |
create-release: | |
name: Draft GitHub release | |
runs-on: ubuntu-latest | |
needs: [ deploy-maven, deploy-python, deploy-docker ] | |
steps: | |
- name: Extract tag name | |
id: extract_tag | |
run: echo "TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.TAG_NAME }} | |
name: ${{ env.TAG_NAME }} | |
draft: true | |
prerelease: false |