Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
d204abe5
Unverified
Commit
d204abe5
authored
1 year ago
by
Ryan Laurie
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Make Pre-Release checks trigger on workflow_dispatch (#35185)
parent
44a7e597
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.github/workflows/build-for-release.yml
+22
-0
22 additions, 0 deletions
.github/workflows/build-for-release.yml
.github/workflows/pre-release.yml
+29
-28
29 additions, 28 deletions
.github/workflows/pre-release.yml
with
51 additions
and
28 deletions
.github/workflows/build-for-release.yml
+
22
−
0
View file @
d204abe5
...
...
@@ -192,3 +192,25 @@ jobs:
./metabase.jar
./COMMIT-ID
./SHA256.sum
trigger-tests
:
needs
:
[
build-uberjar-for-release
]
permissions
:
actions
:
write
runs-on
:
ubuntu-22.04
timeout-minutes
:
5
steps
:
-
name
:
trigger pre-release testing
uses
:
actions/github-script@v6
with
:
script
:
|
# js
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'pre-release.yml',
ref: '${{ github.ref }}',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
}
});
This diff is collapsed.
Click to expand it.
.github/workflows/pre-release.yml
+
29
−
28
View file @
d204abe5
name
:
Release 2 - Pre-release testing
run-name
:
Pre-release
T
esting of ${{
github.event.workflow_run.name
}}
run-name
:
Pre-release
t
esting of ${{
inputs.version
}}
on
:
workflow_run
:
workflows
:
[
Release 1 - Build Release Artifact
]
types
:
[
completed
]
workflow_dispatch
:
inputs
:
version
:
description
:
'
Metabase
version
(e.g.
v0.46.3)'
type
:
string
required
:
true
commit
:
description
:
'
A
full-length
commit
SHA-1
hash'
required
:
true
jobs
:
release-artifact
:
if
:
${{ github.event.workflow_run.conclusion == 'success' }}
runs-on
:
ubuntu-22.04
timeout-minutes
:
10
strategy
:
...
...
@@ -18,36 +23,33 @@ jobs:
ee_version
:
${{ steps.version-properties.outputs.ee_version }}
oss_version
:
${{ steps.version-properties.outputs.oss_version }}
commit
:
${{ steps.version-properties.outputs.commit }}
env
:
GITHUB_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
steps
:
-
name
:
Checkout repository
uses
:
actions/checkout@v3
-
name
:
'
Download
artifact'
-
name
:
find_release_artifact
id
:
find_release_artifact
uses
:
actions/github-script@v6
with
:
script
:
|
result-encoding
:
string
script
:
|
# js
const fs = require('fs');
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
const matchArtifact = allArtifacts.data.artifacts.find((artifact) => {
return artifact.name.includes('-${{ matrix.edition }}-');
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: `metabase-${{ matrix.edition }}-${{ inputs.commit }}-uberjar`,
per_page: 1,
});
if (!
matchArtifact
) {
throw new Error(
'
No artifact found
'
);
if (!
artifacts.data?.artifacts?.[0]?.id
) {
throw new Error(
`
No artifact
s
found
for ${{ inputs.commit }}`
);
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id:
matchA
rtifact
.
id,
archive_format: 'zip',
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id:
a
rtifact
_
id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
...
...
@@ -56,14 +58,13 @@ jobs:
-
name
:
Extract the version.properties file from the JAR
run
:
|
jar xf metabase.jar version.properties
mv version.properties resources/
-
name
:
Reveal Metabase ${{ matrix.edition }} properties
id
:
version-properties
run
:
|
cat
./resources/
version.properties
cat version.properties
echo "commit=$(cat ./COMMIT-ID)" >> $GITHUB_OUTPUT
version=$(grep -o '^tag=.*'
./resources/
version.properties | cut -d'=' -f2)
version=$(grep -o '^tag=.*' version.properties | cut -d'=' -f2)
if [[ "${{ matrix.edition }}" == "ee" ]]; then
echo "ee_version=$version" >> $GITHUB_OUTPUT
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment