Skip to content

Update dependency httpx to v0.28.1 #26

Update dependency httpx to v0.28.1

Update dependency httpx to v0.28.1 #26

Workflow file for this run

# This workflow is based on work from asterisk-hass-addons
# Copyright (c) 2021 TECH Fox, under MIT license
name: Build and publish image to GitHub Package Registry
on:
push:
branches: [ master, 'release/*' ]
tags: [ 'v*' ]
workflow_dispatch: ~
repository_dispatch:
types: [ dependency_commit ]
env:
REGISTRY_REPOSITORY_NAME: minecraft-maven-bridge
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Get lowercase GitHub username
id: repository_owner
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.repository_owner }}
- name: Set outputs
id: set-outputs
run: |
echo 'image=ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/${{ env.REGISTRY_REPOSITORY_NAME }}' >> "${GITHUB_OUTPUT}"
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ steps.set-outputs.outputs.image }}
flavor: latest=auto
tags: |
type=schedule,pattern=nightly
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
type=ref,event=pr
type=edge,enable=true
type=sha,enable=true,prefix={{branch}}-,format=short
outputs:
image: ${{ steps.set-outputs.outputs.image }}
meta-version: ${{ steps.meta.outputs.version }}
meta-labels: ${{ steps.meta.outputs.labels }}
meta-json: ${{ steps.meta.outputs.json }}
meta-tags: ${{ steps.meta.outputs.tags }}
build-and-push-image:
needs:
- prepare
runs-on: ubuntu-latest
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64/v8
push: true
tags: ${{ needs.prepare.outputs.meta-tags }}
labels: ${{ needs.prepare.outputs.meta-labels }}
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ needs.prepare.outputs.image }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true