diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..fc3d476 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,23 @@ +name: Release Drafter +on: + push: + branches: + - main + pull_request: + types: [opened, reopened, synchronize] +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v6 + with: + config-name: release-drafter-config.yml + publish: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b58c0c0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,56 @@ +name: release +on: + release: + types: [published] +env: + IMAGE_NAME: docker/attest-provider +jobs: + dockerhub: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: dockerpublicbot + password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }} + - name: Generate GitHub App Token + id: app-token + uses: actions/create-github-app-token@ad38cffc07bac6e3857755914c4c88bfd2db4da4 # v1.10.2 + with: + app-id: ${{ vars.APP_ID }} + private-key: ${{ secrets.DOCKER_READ_APP_PRIVATE_KEY }} + repositories: "attest" + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + version: lab:latest + driver: cloud + endpoint: docker/default + install: true + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + target: production + build-args: | + VERSION=v${{ steps.meta.outputs.version }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 # todo figure out additional platforms for release + attests: type=sbom,generator=docker/scout-sbom-indexer:1 + provenance: mode=max + secrets: | + GITHUB_TOKEN=${{ steps.app-token.outputs.token }}