chore: bump version to 0.5.0 #15
Workflow file for this run
This file contains hidden or 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
| # Copyright (C) 2025 Siemens | |
| # | |
| # SPDX-License-Identifier: MIT | |
| name: Publish | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+' | |
| permissions: | |
| contents: read | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Build release distributions | |
| run: | | |
| python -m pip install build | |
| python -m build | |
| - name: Upload distributions | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| pypi-publish: | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - release-build | |
| permissions: | |
| id-token: write | |
| # Run only on the official repository (skip forks) | |
| if: github.repository == 'siemens/debsbom' | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/debsbom/${{ github.ref_name }} | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| - name: Publish release distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e | |
| deploy_containers: | |
| name: Build and deploy container images | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| id-token: write | |
| packages: write | |
| contents: read | |
| attestations: write | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Get release | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
| - name: Set up docker build | |
| uses: ./.github/actions/docker-init | |
| with: | |
| deploy-user: ${{ github.actor }} | |
| deploy-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Find latest tag | |
| run: echo "LATEST_TAG=$(git tag | sort --version-sort | tail -n1)" >> $GITHUB_ENV | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| id: push | |
| with: | |
| context: /home/runner/debsbom-clone | |
| target: debsbom | |
| platforms: linux/amd64,linux/arm64 | |
| build-args: | | |
| SOURCE_DATE_EPOCH=${{ env.SOURCE_DATE_EPOCH }} | |
| DEBIAN_TAG=${{ env.DEBIAN_TAG }} | |
| provenance: false | |
| outputs: type=registry,rewrite-timestamp=true | |
| tags: | | |
| ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }} | |
| ${{ github.ref_name == env.LATEST_TAG && format('ghcr.io/{0}:latest-release', github.repository) || '' }} | |
| annotations: ${{ env.DOCKER_METADATA_OUTPUT_ANNOTATIONS }} | |
| - name: Attest image | |
| uses: actions/attest-build-provenance@v1 | |
| with: | |
| subject-name: ghcr.io/${{ github.repository }} | |
| subject-digest: ${{ steps.push.outputs.digest }} | |
| push-to-registry: true |