Skip to content

Release 1.0.0

Release 1.0.0 #16

name: Build and publish the release to GitHub releases and PyPi
on:
pull_request:
branches:
- main
jobs:
build-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build with Maven
run: mvn package -DskipTests -Pbuild-with-jdk-11 -Prun-npm
- uses: juliangruber/read-file-action@v1
name: Read VERSION
id: read_version
with:
path: ./VERSION
- uses: docker-practice/actions-setup-docker@master
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build and Push Docker Image
with:
image: dqops/dqo
tags: $(date +%s),${{ steps.read_version.outputs.content }},latest
dockerfile: Dockerfile-fast
enableBuildKit: true
multiPlatform: true
platform: linux/amd64,linux/arm64
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create GitHub release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: v${{ steps.read_version.outputs.content }}
tag_name: v${{ steps.read_version.outputs.content }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload distribution binary file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./distribution/target/dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip
asset_name: dqo-distribution-${{steps.read_version.outputs.content}}-bin.zip
asset_content_type: application/zip
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./distribution/python/requirements.txt
- name: Build PyPi package
run: |
python -m build ./distribution/python
- name: Publish PyPi package
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: distribution/python/dist/
user: __token__
password: ${{ secrets.PYPI_TOKEN }}