Repository navigation
129 lines (116 loc) · 3.97 KB
/
Copy pathrelease.yml
File metadata and controls
129 lines (116 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Release
on:
workflow_call:
secrets:
RELEASE_PLEASE_TOKEN:
required: true
OPENAI_API_KEY:
required: true
# Called workflows don't inherit the caller's env
env:
# renovate: datasource=github-releases depName=jdx/mise
MISE_VERSION: 2026.10.17
jobs:
release:
name: Release
runs-on: ubuntu-26.04
timeout-minutes: 10
permissions:
contents: write
issues: write
pull-requests: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
sha: ${{ steps.release.outputs.sha }}
tag_name: ${{ steps.release.outputs.tag_name }}
version: ${{ steps.release.outputs.version }}
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
with:
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
release-notes:
name: Generate release notes
needs: release
if: ${{ needs.release.outputs.release_created == 'true' }}
runs-on: ubuntu-26.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: read
steps:
- name: Checkout released commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ needs.release.outputs.sha }}
- name: Set up Communiqué
uses: jdx/mise-action@8418fedb1110381a0d3ba51a7a415d7c1b884550 # v5.2.2
with:
version: ${{ env.MISE_VERSION }}
install_args: communique
cache: false
- name: Update GitHub release notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
RELEASE_TAG: ${{ needs.release.outputs.tag_name }}
run: communique generate "$RELEASE_TAG" --github-release
publish:
name: Publish image
needs: release
if: ${{ needs.release.outputs.release_created == 'true' }}
runs-on: ubuntu-26.04
timeout-minutes: 30
permissions:
attestations: write
contents: read
id-token: write
packages: write
env:
IMAGE_NAME: ${{ github.repository }}
REGISTRY: ghcr.io
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
ref: ${{ needs.release.outputs.sha }}
- name: Verify released commit passed CI
run: test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
- name: Set up Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
with:
cache-binary: false
- name: Verify image
uses: $/.github/actions/verify-image
with:
mise-version: ${{ env.MISE_VERSION }}
- name: Log in to the Container registry
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish image
id: build
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
env:
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
platforms: linux/amd64
push: true
sbom: true
secrets: github_token=${{ github.token }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.release.outputs.version }}
- name: Generate artifact attestation
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
# Artifact metadata storage records require an organization-owned repository
create-storage-record: false
push-to-registry: true
subject-digest: ${{ steps.build.outputs.digest }}
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}