forked from metabase/metabase
-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (57 loc) · 2.21 KB
/
release-log.yml
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
name: Update Release Log
run-name: Update Release Log ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Major Metabase version (e.g. 45, 52, 68)'
type: number
required: true
schedule:
- cron: '45 * * * *' # hourly
workflow_call:
inputs:
version:
description: 'Major Metabase version (e.g. 45, 52, 68)'
type: number # needs to be a number to pass variables
required: true
jobs:
update-release-log:
runs-on: ubuntu-latest
timeout-minutes: 5
# don't run this workflow on a cron for forks
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
env:
VERSION: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call')
&& inputs.version || vars.CURRENT_VERSION }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_S3_RELEASE_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_RELEASE_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we want all branches and tags
- name: Install Dependencies
run: yarn --cwd release --frozen-lockfile && npm i -g tsx
- name: generate release Log
run: cd release && tsx ./src/release-log-run.ts $VERSION > v$VERSION.html
- name: generate release channel log
run: cd release && tsx ./src/release-channel-log.ts > channels.html
- name: upload release log to the web
run: |
aws s3 cp \
release/v$VERSION.html \
s3://${{ vars.AWS_S3_STATIC_BUCKET }}/release-log/v$VERSION.html
- name: upload release channel log to the web
run: |
aws s3 cp \
release/channels.html \
s3://${{ vars.AWS_S3_STATIC_BUCKET }}/release-log/channels.html
- name: Create cloudfront invalidation
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \
--paths "/release-log/v$VERSION.html" "/release-log/channels.html"