Update Release Log #250
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |