mirror of
https://github.com/PCSX2/web-api.git
synced 2026-01-31 01:15:16 +01:00
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2 to 3. - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest-build-provenance/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/attest-build-provenance dependency-version: '3' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
94 lines
2.6 KiB
YAML
94 lines
2.6 KiB
YAML
name: 🏭 Draft Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump:
|
|
description: 'Semver Bump Type'
|
|
required: true
|
|
default: 'patch'
|
|
type: choice
|
|
options:
|
|
- patch
|
|
- minor
|
|
- major
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
permissions:
|
|
contents: write
|
|
attestations: write
|
|
packages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
cut_release:
|
|
if: github.repository == 'PCSX2/web-api'
|
|
name: Cut Release
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
new_tag: ${{ steps.set_tag.outputs.new_tag }}
|
|
steps:
|
|
# Docs - https://github.com/mathieudutour/github-tag-action
|
|
- name: Bump Version and Push Tag
|
|
id: tag_version
|
|
uses: mathieudutour/github-tag-action@v6.2
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag_prefix: v
|
|
default_bump: ${{ github.event.inputs.bump }}
|
|
|
|
- name: Create Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release create ${{ steps.tag_version.outputs.new_tag }} --generate-notes --repo ${{ github.repository }}
|
|
|
|
- name: Output new tag
|
|
id: set_tag
|
|
run: |
|
|
echo "new_tag=${{ steps.tag_version.outputs.new_tag }}" >> $GITHUB_OUTPUT
|
|
|
|
publish_image:
|
|
if: github.repository == 'PCSX2/web-api'
|
|
name: "Build and Publish Image"
|
|
needs:
|
|
- cut_release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ needs.cut_release.outputs.new_tag }}
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
tags: |
|
|
type=edge,branch=main
|
|
type=raw,value=${{ needs.cut_release.outputs.new_tag }}
|
|
|
|
- name: Build and push Docker image
|
|
id: push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest-build-provenance@v3
|
|
with:
|
|
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
|
|
subject-digest: ${{ steps.push.outputs.digest }}
|
|
push-to-registry: true |