Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zoom-python-webhook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Samuel Guillemet
zoom-python-webhook
Commits
da10e7a9
Unverified
Commit
da10e7a9
authored
1 year ago
by
Samuel Guillemet
Browse files
Options
Downloads
Patches
Plain Diff
Allow no release push on main
parent
bde7c550
No related branches found
No related tags found
1 merge request
!16
🚀 RELEASE: Bump to 0.2.1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.github/workflows/build.yml
+34
-15
34 additions, 15 deletions
.github/workflows/build.yml
.github/workflows/pull-request-labels.yaml
+5
-5
5 additions, 5 deletions
.github/workflows/pull-request-labels.yaml
.github/workflows/release-on-push.yml
+14
-1
14 additions, 1 deletion
.github/workflows/release-on-push.yml
with
53 additions
and
21 deletions
.github/workflows/build.yml
+
34
−
15
View file @
da10e7a9
...
...
@@ -11,27 +11,45 @@ env:
HARBOR_REGISTRY
:
registry.cern.ch
jobs
:
get-tag-name
:
get-version
:
if
:
github.event.workflow_run.conclusion == 'success'
runs-on
:
ubuntu-latest
outputs
:
tag_name
:
${{ steps.
release-on-push
.outputs.tag_name }}
tag_name
:
${{ steps.
get-tag-name
.outputs.tag_name }}
steps
:
-
name
:
Get the tag name generated by the release-on-push workflow
id
:
release-on-push
uses
:
actions/github-script@v4
-
name
:
Download artifact
uses
:
actions/github-script@v6
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
script
:
|
const last_release = await github.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
const last_release_tag = last_release.data.tag_name;
core.setOutput("tag_name", last_release_tag);
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "version_number"
})[0];
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/version_number.zip`, Buffer.from(download.data));
-
name
:
Unzip artifact
run
:
unzip version_number.zip
-
name
:
Get tag name
id
:
get-tag-name
run
:
|
echo "tag_name=$(cat version_number)" >> $GITHUB_OUTPUT
build-and-push-to-github
:
runs-on
:
ubuntu-latest
needs
:
get-tag-name
needs
:
get-version
if
:
needs.get-version.outputs.tag_name != ''
steps
:
-
name
:
Checkout repository
uses
:
actions/checkout@v3
...
...
@@ -47,13 +65,14 @@ jobs:
run
:
|
docker compose -f docker-compose.yml -f docker-compose.github.yml build
docker compose -f docker-compose.yml -f docker-compose.github.yml push
export tag=${{ needs.get-
tag-name
.outputs.tag_name }}
export tag=${{ needs.get-
version
.outputs.tag_name }}
docker compose -f docker-compose.yml -f docker-compose.github.yml build
docker compose -f docker-compose.yml -f docker-compose.github.yml push
build-and-push-to-harbor
:
runs-on
:
ubuntu-latest
needs
:
get-tag-name
needs
:
get-version
if
:
needs.get-version.outputs.tag_name != ''
steps
:
-
name
:
Checkout repository
uses
:
actions/checkout@v3
...
...
@@ -69,6 +88,6 @@ jobs:
run
:
|
docker compose -f docker-compose.yml -f docker-compose.harbor.yml build
docker compose -f docker-compose.yml -f docker-compose.harbor.yml push
export tag=${{ needs.get-
tag-name
.outputs.tag_name }}
export tag=${{ needs.get-
version
.outputs.tag_name }}
docker compose -f docker-compose.yml -f docker-compose.harbor.yml build
docker compose -f docker-compose.yml -f docker-compose.harbor.yml push
This diff is collapsed.
Click to expand it.
.github/workflows/pull-request-labels.yaml
+
5
−
5
View file @
da10e7a9
...
...
@@ -10,7 +10,7 @@ jobs:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Checkout
uses
:
actions/checkout@v
2
uses
:
actions/checkout@v
3
with
:
fetch-depth
:
0
...
...
@@ -21,19 +21,19 @@ jobs:
-
name
:
Get the label to add
id
:
get_label
uses
:
actions/github-script@v
3
uses
:
actions/github-script@v
6
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
script
:
|
const labels = ["release:patch", "release:minor", "release:major"];
const last_release = await github.repos.getLatestRelease({
const labels = ["release:patch", "release:minor", "release:major"
, "norelease"
];
const last_release = await github.
rest.
repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
});
const last_release_tag = last_release.data.tag_name;
const last_release_version = last_release_tag.replace("v", "");
if (last_release_version === process.env.VERSION) {
core.set
Failed("The version has not been bumped"
);
core.set
Output("label", labels[3]
);
} else {
const last_release_version_split = last_release_version.split(".");
const current_version_split = process.env.VERSION.split(".");
...
...
This diff is collapsed.
Click to expand it.
.github/workflows/release-on-push.yml
+
14
−
1
View file @
da10e7a9
...
...
@@ -16,7 +16,7 @@ jobs:
id
:
release
uses
:
rymndhng/release-on-push-action@master
with
:
bump_version_scheme
:
patch
bump_version_scheme
:
"
norelease"
tag_prefix
:
v
release_name
:
<RELEASE_TAG>
max_commits
:
25
...
...
@@ -26,3 +26,16 @@ jobs:
outputs
:
tag_name
:
${{ steps.release.outputs.tag_name }}
version
:
${{ steps.release.outputs.version }}
store-version
:
needs
:
release-on-push
runs-on
:
ubuntu-latest
steps
:
-
name
:
Save version
run
:
|
mkdir -p ./version
echo "${{ needs.release-on-push.outputs.version }}" > ./version/version_number
-
uses
:
actions/upload-artifact@v2
with
:
name
:
version_number
path
:
./version
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