* Use bun in package.json * Update workflows * Update more workflows * Kick ci * Fix yaml * Fix type errors * Compat with snyk * Fix jest resolutions * Add another esm package * Fix aliases and next js missing deps * Update next js embed tests * Try fix embed test config * Fix * Fix requires in e2e support * Use bun not yarn in embed bin * Revert config changes * Use bun in more scripts and use prepare-release action * Replace more yarn usages * Remove overrides from bunfig move to package json * Revert e2e support changes * Add back comment * [ci skip] comment typo * Update bun lock * Update to reference bun * Update to reference bun * Update license disclaimer * Tidy tests * Update to use bun in workflows * Change aliases * Update codemirrort selector * Tidy license generation * Remove .only * Fix yarn references * Checkout .github for release scripts * Update lockfile * Re-add package * update release bunlock * fix checkout check --------- Co-authored-by: Ryan Laurie <iethree@gmail.com>
95 lines
3.2 KiB
YAML
95 lines
3.2 KiB
YAML
name: Update Release Log
|
|
run-name: Update Release Log ${{ inputs.version || github.ref_name }}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- release-x.*
|
|
tags:
|
|
- v*
|
|
- latest-*
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Major Metabase version (e.g. 45, 52, 68)'
|
|
type: number
|
|
required: true
|
|
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 for forks
|
|
if: ${{ github.event_name != 'push' || github.repository == 'metabase/metabase' }}
|
|
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:
|
|
ref: master # this only works on master
|
|
fetch-depth: 0 # we want all branches and tags
|
|
- name: Install bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
- name: Install Dependencies
|
|
run: bun install --cwd release --frozen-lockfile && npm i -g tsx
|
|
- name: Build release scripts
|
|
run: bun run --cwd release build
|
|
- name: Get version number
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: | # js
|
|
const {
|
|
getMajorVersionFromRef,
|
|
getMajorVersion,
|
|
} = require('${{ github.workspace }}/release/dist/index.cjs');
|
|
|
|
console.log({ context });
|
|
|
|
// if the version is explicitly set, use that
|
|
if (context.payload?.inputs?.version) {
|
|
core.exportVariable('VERSION', context.payload.inputs.version);
|
|
return;
|
|
}
|
|
|
|
// otherwise, get the version from the release branch name
|
|
const ref = context.payload.ref;
|
|
const majorVersion = getMajorVersionFromRef(ref);
|
|
|
|
console.log({ ref, majorVersion });
|
|
core.exportVariable('VERSION', majorVersion);
|
|
|
|
- name: generate release Log
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
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"
|