Skip to content

Commit

Permalink
wip: release checklist creation
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmetNSimsek committed Feb 19, 2024
1 parent edc2950 commit b79b634
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/release-checklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: '[ci] release-checklist'

on:
push:
tags:
'**'
workflow_run:
workflows: ["test configuration"]
branches: [master]
types:
- completed

jobs:
generate-update:
runs-on: ubuntu-latest
environment:
RELEASE_CHECKLIST_TAG: release-checklist
RELEASE_TAG_ENV: '.latest-tag.env'
OPENED_IID_ENV: '.all-opened.env'
run: |
pip install -U pip
pip install -r _ci/requirements.txt
steps:
- name: install dependencies
run: |
apt-get update -y && apt-get install -y jq
pip install requests
- name: get-latest-tag
if: $CI_PIPELINE_SOURCE == "parent_pipeline"
run: |
url="$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/tags"
echo "url: $url"
newest_tag=$(curl -s $url | jq -r ".[0].name")
echo "newest_tag $newest_tag"
echo "export NEWEST_TAG=$newest_tag" >> $RELEASE_TAG_ENV
- name: get-all-opened
if: $CI_PIPELINE_SOURCE == "parent_pipeline"
run:

- name: update
run: |
- name: createnew
run: |
python ./_ci/create_new_issue.py
get-all-opened:
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
stage: collection
extends: .install-dep
artifacts:
paths:
- $OPENED_IID_ENV
script: |
url="$CI_API_V4_URL/projects/$CI_PROJECT_ID/issues?labels=${RELEASE_CHECKLIST_TAG}&state=opened"
echo "url: $url"
all_issues_id=$(curl -s $url | jq -r ".[].iid")
echo "all_issues_id $all_issues_id"
echo "ALL_IID=$all_issues_id" >> $OPENED_IID_ENV
close-existing-issues:
stage: update
extends: .install-dep
dependencies:
- get-all-opened
- get-latest-tag
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
script: |
if [[ -z "$RELEASE_CHECKLIST_CI_TOKEN" ]]
then
echo "RELEASE_CHECKLIST_CI_TOKEN not set, terminating!"
exit 1
fi
cat $RELEASE_TAG_ENV
cat $OPENED_IID_ENV
source $OPENED_IID_ENV
echo ALL_IID: $ALL_IID
for iid in $ALL_IID
do
url="$CI_API_V4_URL/projects/$CI_PROJECT_ID/issues/$iid"
echo Closing issue id: $iid with url: $url
curl -v -XPUT -H "PRIVATE-TOKEN: $RELEASE_CHECKLIST_CI_TOKEN" ${url}?state_event=close
done

open-new-issue:
stage: createnew
extends: .install-dep
dependencies:
- get-latest-tag
rules:
- if: $CI_PIPELINE_SOURCE == "parent_pipeline"
script: |
if [[ -z "$RELEASE_CHECKLIST_CI_TOKEN" ]]
then
echo "RELEASE_CHECKLIST_CI_TOKEN not set, terminating!"
exit 1
fi
cat $RELEASE_TAG_ENV
source $RELEASE_TAG_ENV
python ./_ci/create_new_issue.py

0 comments on commit b79b634

Please sign in to comment.