mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-05-26 18:23:53 +00:00
122 lines
3.7 KiB
YAML
122 lines
3.7 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
id-token: write
|
|
attestations: write
|
|
artifact-metadata: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: depot-ubuntu-24.04-16
|
|
env:
|
|
CONTAINER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/pocket-id
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v5
|
|
with:
|
|
run_install: false
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: pnpm
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: backend/go.mod
|
|
cache-dependency-path: backend/go.sum
|
|
|
|
- name: Set up Depot CLI
|
|
uses: depot/setup-action@v1
|
|
|
|
- name: Setup depot buildx driver
|
|
run: depot configure-docker
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.CONTAINER_IMAGE_NAME }}
|
|
tags: |
|
|
type=semver,pattern={{version}},prefix=v
|
|
type=semver,pattern={{major}}.{{minor}},prefix=v
|
|
type=semver,pattern={{major}},prefix=v
|
|
labels: |
|
|
org.opencontainers.image.authors=Pocket ID
|
|
org.opencontainers.image.url=https://github.com/pocket-id/pocket-id
|
|
org.opencontainers.image.documentation=https://github.com/pocket-id/pocket-id/blob/main/README.md
|
|
org.opencontainers.image.source=https://github.com/pocket-id/pocket-id
|
|
org.opencontainers.image.version=next
|
|
org.opencontainers.image.licenses=BSD-2-Clause
|
|
org.opencontainers.image.ref.name=pocket-id
|
|
org.opencontainers.image.title=Pocket ID
|
|
|
|
- name: Build and push container image
|
|
uses: depot/build-push-action@v1
|
|
id: container-build-push
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
sbom: false
|
|
provenance: true
|
|
|
|
- name: Container image attestation
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-name: "${{ env.CONTAINER_IMAGE_NAME }}"
|
|
subject-digest: ${{ steps.container-build-push.outputs.digest }}
|
|
push-to-registry: true
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v7
|
|
with:
|
|
distribution: goreleaser-pro
|
|
version: "~> v2"
|
|
args: release --clean --skip=validate --parallelism=4
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
|
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
|
|
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}
|
|
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
|
|
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
|
|
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
- name: Binary attestation
|
|
uses: actions/attest-build-provenance@v2
|
|
with:
|
|
subject-path: "dist/pocket-id_**"
|
|
|
|
- name: Publish release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: gh release edit ${{ github.ref_name }} --draft=false
|