Skip to content
Snippets Groups Projects
Unverified Commit 89ad60ae authored by Ryan Laurie's avatar Ryan Laurie Committed by GitHub
Browse files

Add release channel option to publish job (#48633)

* only tag nightly on the current version

* add release channel setting to publish job

* clean up release workflow

* remove code from something else

* fix step title
parent d82015eb
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,7 @@ on:
# - nightly
# - beta
# - latest
# - none (skips everything)
required: true
tag_rollout:
description: Rollout % (0-100)
......@@ -54,7 +55,15 @@ on:
default: true
jobs:
green-check-stub:
runs-on: ubuntu-22.04
timeout-minutes: 2
steps:
- name: Stub
run: echo "Stub to make this job successful even if all the rest of the steps are skipped"
check-version:
# skips everything if the tag_name is 'none' because all later jobs depend on this job
if: ${{ inputs.tag_name != 'none' }}
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
......@@ -185,7 +194,7 @@ jobs:
return upload_path;
- name: Upload to s3 latest path
- name: Upload to s3 ${{ inputs.tag_name }} path
run: | # sh
aws s3 cp \
s3://${{ vars.AWS_S3_DOWNLOADS_BUCKET }}/${{ steps.source_path.outputs.result }}/metabase.jar \
......@@ -270,7 +279,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history
fetch-depth: 0 # we want all branches and tags
fetch-tags: true
- name: Add and push git tag
run: | # sh
......@@ -333,7 +343,6 @@ jobs:
});
fs.writeFileSync('version-info.json', JSON.stringify(newVersionInfo));
- name: Upload new version-info.json to S3
run: |
if [[ "${{ matrix.edition }}" == "ee" ]]; then
......
......@@ -11,26 +11,16 @@ on:
commit:
description: 'A full-length commit SHA-1 hash'
required: true
skip-docker:
description: 'Skip Docker image publishing'
type: boolean
default: false
skip-s3:
description: 'Skip S3 artifact publishing'
type: boolean
default: false
skip-version-info:
description: 'Skip publishing version-info.json'
type: boolean
default: false
skip-tag:
description: 'Skip tagging the release'
type: boolean
default: false
skip-release-notes:
description: 'Skip publishing release notes'
type: boolean
default: false
release-channel:
description: 'The release channel to publish to (optional)'
type: choice
options:
- none
- latest
- beta
- nightly
required: true
default: 'none'
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
......@@ -192,7 +182,6 @@ jobs:
./version.properties
upload-to-s3:
if: ${{ inputs.skip-s3 != true }}
runs-on: ubuntu-22.04
needs: download-uberjar
timeout-minutes: 15
......@@ -242,7 +231,6 @@ jobs:
verify-s3-download:
if: ${{ inputs.skip-s3 != true }}
runs-on: ubuntu-22.04
needs: upload-to-s3
timeout-minutes: 15
......@@ -276,7 +264,6 @@ jobs:
run: grep -q $(sha256sum ./metabase-downloaded.jar) SHA256.sum && echo "checksums match" || exit 1
containerize:
if: ${{ inputs.skip-docker != true }}
runs-on: ubuntu-22.04
needs: [check-version, download-uberjar]
timeout-minutes: 15
......@@ -361,7 +348,6 @@ jobs:
echo "Finished!"
verify-docker-pull:
if: ${{ inputs.skip-docker != true }}
runs-on: ubuntu-22.04
needs: containerize
timeout-minutes: 15
......@@ -410,7 +396,6 @@ jobs:
timeout-minutes: 3
push-tags:
if: ${{ inputs.skip-tag != true }}
permissions: write-all
needs: [verify-s3-download, verify-docker-pull, check-version]
runs-on: ubuntu-22.04
......@@ -461,7 +446,7 @@ jobs:
$GITHUB_WORKSPACE/release/reorder-tags.sh ${{ needs.check-version.outputs.ee }} ${{ inputs.commit }}
trigger-docs-update:
if: ${{ !inputs.auto && inputs.skip-release-notes != true }}
if: ${{ !inputs.auto }}
needs:
- push-tags
- check-version
......@@ -577,7 +562,7 @@ jobs:
});
draft-release-notes:
if: ${{ !inputs.auto && inputs.skip-release-notes != true }}
if: ${{ !inputs.auto }}
needs: push-tags
runs-on: ubuntu-22.04
timeout-minutes: 15
......@@ -629,7 +614,6 @@ jobs:
});
publish-version-info:
if: ${{ !inputs.auto && inputs.skip-version-info != true }}
runs-on: ubuntu-22.04
needs: [push-tags, check-version]
timeout-minutes: 15
......@@ -640,6 +624,11 @@ jobs:
AWS_S3_STATIC_BUCKET: ${{ vars.AWS_S3_STATIC_BUCKET }}
AWS_REGION: ${{ vars.AWS_REGION }}
steps:
- name: Finish early
if: ${{ inputs.auto }}
run: |
echo "skipping version info update for nightly patch"
exit 0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
......@@ -687,22 +676,20 @@ jobs:
--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \
--paths "/version-info.json" "/version-info-ee.json"
tag-nightly:
if: false
needs: [push-tags, verify-docker-pull, verify-s3-download, check-version]
set-release-channel:
needs: publish-version-info
uses: ./.github/workflows/release-tag.yml
secrets: inherit
with:
version: ${{ inputs.version }}
tag_name: nightly
tag_name: ${{ inputs.release-channel }}
tag_rollout: 100
tag_ee: true
tag_oss: true
publish-complete-message:
if: ${{ !inputs.auto }}
runs-on: ubuntu-22.04
needs: [draft-release-notes, verify-docker-pull, verify-s3-download, publish-version-info]
needs: set-release-channel
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
......@@ -719,34 +706,7 @@ jobs:
script: | # js
const { sendPublishCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendPublishCompleteMessage({
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: 'general',
}).catch(console.error);
auto-publish-complete-message:
if: ${{ inputs.auto }}
runs-on: ubuntu-22.04
needs: tag-nightly
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send auto publish complete message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendPublishCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
const isAutoRelease = '${{ inputs.auto }}' === 'true';
await sendPublishCompleteMessage({
owner: context.repo.owner,
......@@ -754,7 +714,7 @@ jobs:
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: '',
generalChannelName: !isAutoRelease ? '${{ vars.SLACK_GENERAL_CHANNEL }}' : '',
}).catch(console.error);
manage-milestones:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment