Merge branch 'main' of github.com:pdreker/fritz_exporter #157
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
on: | |
push: | |
branches: | |
- main | |
name: release-please | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
major: ${{ steps.release.outputs.major }} | |
minor: ${{ steps.release.outputs.minor }} | |
patch: ${{ steps.release.outputs.patch }} | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.MASTER_PUSH_TOKEN }} | |
build-docker-release: | |
needs: release | |
if: needs.release.outputs.release_created | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ vars.DOCKER_REGISTRY_HOST }} | |
username: ${{ vars.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB }} | |
- name: generate docker tags | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ vars.DOCKER_REGISTRY_HOST }}/${{ vars.DOCKER_REGISTRY_REPO }}/${{ vars.DOCKER_REGISTRY_IMAGE }} | |
tags: | | |
type=semver,pattern={{version}},value=${{ needs.release.outputs.major }}.${{ needs.release.outputs.minor }}.${{ needs.release.outputs.patch }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.major }}.${{ needs.release.outputs.minor }}.${{ needs.release.outputs.patch }} | |
type=semver,pattern={{major}},value=${{ needs.release.outputs.major }}.${{ needs.release.outputs.minor }}.${{ needs.release.outputs.patch }} | |
# Build Docker Images (amd64 and arm64) | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: . | |
platforms: linux/arm/v6,linux/arm/v7,linux/amd64,linux/aarch64 | |
tags: ${{ steps.meta.outputs.tags }} | |
build-pypi-release: | |
needs: release | |
if: needs.release.outputs.release_created | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ vars.PYTHON_VERSION }} | |
- name: Setup poetry | |
uses: abatilo/actions-poetry@v3 | |
with: | |
poetry-version: ${{ vars.POETRY_VERSION }} | |
- name: setup poetry | |
run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
- name: build and publish to PyPI | |
run: poetry --build --no-interaction publish |