Skip to content

Commit fb76668

Browse files
committed
ci: add internal release workflows
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 9a77059 commit fb76668

3 files changed

Lines changed: 91 additions & 4 deletions

File tree

‎.github/workflows/__need-fix-to-issue.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ on:
1616

1717
permissions: {}
1818

19-
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}
21-
cancel-in-progress: true
22-
2319
jobs:
2420
main:
2521
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@5fbb531db839a26ebcc35c4946be279f945f7633 # 1.0.0
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Internal - Prepare release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
types: [opened, reopened, synchronize, edited]
8+
9+
permissions: {}
10+
11+
jobs:
12+
release:
13+
uses: hoverkraft-tech/ci-github-publish/.github/workflows/prepare-release.yml@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
14+
permissions:
15+
contents: read
16+
pull-requests: write

‎.github/workflows/__release.yml‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Internal - Release
2+
3+
on:
4+
workflow_dispatch:
5+
# checkov:skip=CKV_GHA_7: force only bypasses the no-changes guard; source and build settings stay fixed.
6+
inputs:
7+
force:
8+
description: Release even when no relevant changes are detected
9+
type: boolean
10+
required: false
11+
default: false
12+
13+
schedule:
14+
- cron: "25 8 * * 1"
15+
16+
permissions: {}
17+
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: false
21+
22+
jobs:
23+
ci:
24+
if: github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch
25+
uses: $/.github/workflows/__shared-ci.yml
26+
permissions:
27+
actions: read
28+
attestations: write
29+
contents: read
30+
packages: write
31+
pull-requests: write
32+
id-token: write
33+
issues: write
34+
security-events: write
35+
statuses: write
36+
37+
release:
38+
name: Create and publish release
39+
needs: ci
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read
43+
pull-requests: read
44+
steps:
45+
# Use the app token so publishing the tag triggers the main CI documentation jobs.
46+
- id: generate-token
47+
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
48+
with:
49+
client-id: ${{ vars.CI_BOT_APP_CLIENT_ID }}
50+
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }} # zizmor: ignore[secrets-outside-env] CI bot authentication is required to trigger tag workflows
51+
permission-contents: write
52+
permission-pull-requests: read
53+
54+
- name: Plan release
55+
id: plan-release
56+
uses: hoverkraft-tech/ci-github-publish/actions/release/plan@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
57+
with:
58+
target-sha: ${{ github.sha }}
59+
github-token: ${{ steps.generate-token.outputs.token }}
60+
61+
- name: Create and publish release
62+
if: (steps.plan-release.outputs.has-changes == 'true' || (github.event_name == 'workflow_dispatch' && inputs.force)) && steps.plan-release.outputs.tag != ''
63+
uses: hoverkraft-tech/ci-github-publish/actions/release/create@f06e0e72a76bfca57c34d08d03e5c1914275fd4c # 2.0.0
64+
env:
65+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} # zizmor: ignore[secrets-outside-env] repository secret is scoped to the release summary step
66+
with:
67+
tag: ${{ steps.plan-release.outputs.tag }}
68+
target-sha: ${{ github.sha }}
69+
publish: "true"
70+
changelog-summary: |
71+
{
72+
"llmAuth": ${{ toJSON(env.OPENAI_API_KEY) }},
73+
"llmProvider": "openai"
74+
}
75+
github-token: ${{ steps.generate-token.outputs.token }}

0 commit comments

Comments
 (0)