-
Notifications
You must be signed in to change notification settings - Fork 372
159 lines (152 loc) · 5.09 KB
/
release-nightly.yml
File metadata and controls
159 lines (152 loc) · 5.09 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: Release Nightly
on:
schedule:
# Run at 0:00 AM UTC every day
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
packages: write
pull-requests: write
actions: read
jobs:
release:
name: Release
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
release:
- release-all-in-one-nightly
- release-app-nightly
- release-local-nightly
- release-otel-collector-nightly
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
docker-images: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Load Environment Variables from .env
uses: xom9ikk/dotenv@v2
- name: Publish Images
run: make ${{ matrix.release }}
slack-notify-failure:
needs: release
runs-on: ubuntu-24.04
if: failure() && always()
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get failed jobs
id: get_failed_jobs
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const response = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
});
const failedJobs = response.data.jobs
.filter(job => job.status === 'completed' && job.conclusion === 'failure')
.map(job => job.name)
.join(', ');
core.setOutput('failed_jobs', failedJobs);
- name: Slack Notification
uses: 8398a7/action-slack@v3
with:
status: custom
fields: repo,workflow,commit,author
custom_payload: |
{
"text": "Release Nightly Failed 😔",
"attachments": [{
"color": "danger",
"fields": [
{
"title": "Failed Build",
"value": "${{ steps.get_failed_jobs.outputs.failed_jobs }}",
"short": false
},
{
"title": "Commit",
"value": "<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>",
"short": false
},
{
"title": "Author",
"value": "${{ github.actor }}",
"short": true
}
]
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_ENG_NOTIFS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# notify_downstream:
# name: Notify Downstream
# needs: [publish_common_utils, release]
# runs-on: ubuntu-24.04
# if:
# needs.publish_common_utils.outputs.changeset_outputs_hasChangesets ==
# 'false'
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Load Environment Variables from .env
# uses: xom9ikk/dotenv@v2
# - name: Get Downstream App Installation Token
# id: auth
# uses: actions/create-github-app-token@v2
# with:
# app-id: ${{ secrets.DOWNSTREAM_CH_APP_ID }}
# private-key: ${{ secrets.DOWNSTREAM_CH_APP_PRIVATE_KEY }}
# owner: ${{ secrets.DOWNSTREAM_CH_OWNER }}
# - name: Notify Downstream
# uses: actions/github-script@v7
# env:
# TAG: ${{ env.IMAGE_VERSION }}${{ env.IMAGE_VERSION_SUB_TAG }}
# with:
# github-token: ${{ steps.auth.outputs.token }}
# script: |
# const { TAG } = process.env;
# const result = await github.rest.actions.createWorkflowDispatch({
# owner: '${{ secrets.DOWNSTREAM_CH_OWNER }}',
# repo: '${{ secrets.DOWNSTREAM_DP_REPO }}',
# workflow_id: '${{ secrets.DOWNSTREAM_DP_WORKFLOW_ID }}',
# ref: 'main',
# inputs: {
# tag: TAG
# }
# });