Skip to content

Commit 8dc8dab

Browse files
authored
ci: hackathon release process improvements (#5049)
Add significant automation to Alloy's release process to reduce developer burden. See #5078 for more details
1 parent 4cec6b3 commit 8dc8dab

56 files changed

Lines changed: 4407 additions & 766 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ pkg/operator/crds/*.yaml linguist-generated=true
44
Makefile text eol=lf
55
tools/make/*.mk text eol=lf
66
tools/image-tag text eol=lf
7-
tools/release text eol=lf
7+
tools/publish-release-assets.sh text eol=lf

.github/pull_request_template.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<!--
22
3-
CONTRIBUTORS GUIDE: https://github.com/grafana/alloy/blob/main/docs/developer/contributing.md#updating-the-changelog
3+
CONTRIBUTORS GUIDE: https://github.com/grafana/alloy/blob/main/docs/developer/contributing.md
44
55
If this is your first PR or you have not contributed in a while, we recommend
6-
taking the time to review the guide. It gives helpful instructions for
7-
contributors around things like how to update the changelog.
6+
taking the time to review the guide.
87
98
-->
109

@@ -21,7 +20,6 @@ contributors around things like how to update the changelog.
2120

2221
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->
2322

24-
- [ ] CHANGELOG.md updated
2523
- [ ] Documentation added
2624
- [ ] Tests updated
2725
- [ ] Config converters updated

.github/workflows/autolock.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
1-
name: Lock closed issues and PRs
1+
name: Auto-lock conversations
2+
23
on:
3-
workflow_dispatch: {}
4+
pull_request_target: # zizmor: ignore[dangerous-triggers] Only used to lock PRs from forks
5+
types: [closed]
46
schedule:
57
- cron: '0 0 * * *'
6-
7-
permissions:
8-
issues: write
9-
pull-requests: write
10-
discussions: write
11-
12-
concurrency:
13-
group: lock-threads
8+
workflow_dispatch:
149

1510
jobs:
16-
action:
11+
lock-pr-on-close:
12+
if: github.event_name == 'pull_request_target'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Lock PR conversation 🔏
16+
env:
17+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
PR_URL: ${{ github.event.pull_request.html_url }}
19+
run: |
20+
gh pr lock "$PR_URL"
21+
permissions:
22+
pull-requests: write
23+
24+
lock-stale-issues:
25+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
1726
runs-on: ubuntu-latest
1827
steps:
19-
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
28+
- name: Lock stale issue conversations 🔏
29+
uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
2030
with:
21-
pr-inactive-days: 30
22-
issue-inactive-days: 30
31+
issue-inactive-days: 14
2332
add-issue-labels: 'frozen-due-to-age'
24-
add-pr-labels: 'frozen-due-to-age'
25-
process-only: 'issues, prs'
33+
process-only: 'issues'
34+
permissions:
35+
issues: write

.github/workflows/backport.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/check-sync-module-dependencies.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1313
with:
1414
fetch-depth: 0
15+
persist-credentials: false
1516

1617
- name: Set up Go
1718
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5

.github/workflows/check-versioned-files.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/check-windows-container.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99
- '.github/workflows/check-windows-container.yml'
1010
- '.github/workflows/publish-alloy.yml'
1111
- '.github/workflows/publish-alloy-devel.yml'
12-
- '.github/workflows/publish-alloy-release.yml'
12+
- '.github/workflows/release-publish-alloy-artifacts.yml'
1313
pull_request:
1414
paths:
1515
- 'Dockerfile.windows'
1616
- 'tools/ci/docker-containers-windows'
1717
- '.github/workflows/check-windows-container.yml'
1818
- '.github/workflows/publish-alloy.yml'
1919
- '.github/workflows/publish-alloy-devel.yml'
20-
- '.github/workflows/publish-alloy-release.yml'
20+
- '.github/workflows/release-publish-alloy-artifacts.yml'
2121

2222
permissions:
2323
contents: read

.github/workflows/integration-tests-k8s.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout code
1717
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
with:
19+
persist-credentials: false
1820
- name: Setup Go
1921
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
2022
with:
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: PR Title Lint
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: read
12+
id-token: write
13+
14+
jobs:
15+
lint-pr-title:
16+
name: Validate PR title
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Get GitHub app secrets 🔐
20+
id: get-secrets
21+
uses: grafana/shared-workflows/actions/get-vault-secrets@a37de51f3d713a30a9e4b21bcdfbd38170020593 # get-vault-secrets/v1.3.0
22+
with:
23+
export_env: false
24+
repo_secrets: |
25+
ALLOYBOT_APP_ID=alloybot:app_id
26+
ALLOYBOT_PRIVATE_KEY=alloybot:private_key
27+
28+
- name: Generate token 🔐
29+
uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0
30+
id: app-token
31+
with:
32+
app-id: ${{ fromJSON(steps.get-secrets.outputs.secrets).ALLOYBOT_APP_ID }}
33+
private-key: ${{ fromJSON(steps.get-secrets.outputs.secrets).ALLOYBOT_PRIVATE_KEY }}
34+
owner: grafana
35+
repositories: alloy
36+
37+
- name: Validate PR title 🔎
38+
uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
39+
env:
40+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
41+
with:
42+
# Require conventional commit types
43+
types: |
44+
feat
45+
fix
46+
docs
47+
style
48+
refactor
49+
perf
50+
test
51+
build
52+
ci
53+
chore
54+
revert
55+
# Scope is optional
56+
requireScope: false
57+
# Disallow uppercase first letter in subject
58+
subjectPattern: ^[a-z].+$
59+
subjectPatternError: |
60+
The subject "{subject}" must start with a lowercase letter.
61+
Example: "feat: add new component" not "feat: Add new component"

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
packaging,\
5656
production,\
5757
tools/ci,\
58-
tools/release,\
58+
tools/publish-release-assets.sh,\
5959
docs/sources/tutorials/assets\
6060
"
6161

0 commit comments

Comments
 (0)