Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 155 additions & 0 deletions .github/workflows/create-release-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This code was partially generated by Co-pilot

name: Create Release Issues

on:
workflow_dispatch:
inputs:
version:
description: "Release version (label and titles, i.e. 8 or 21)"
required: true
type: string
releaseDate:
description: "Release date (Month and Year, e.g. 'July 2025')"
required: true
type: string
matrixInt:
description: "Which variant of matrix coverage to apply"
required: false
type: number
pipelineUrl:
description: "URL of the release pipeline"
required: false
type: string
repository_dispatch:
types: [custom_event]

permissions:
contents: read
issues: write
pull-requests: read

jobs:
create-issues:
runs-on: ubuntu-latest
steps:
- name: Create parent and sub-issues
env:
GH_TOKEN: ${{ secrets.TEMURIN_ISSUES_TOKEN || secrets.GITHUB_TOKEN }}
VERSION: "JDK${{ inputs.version || github.event.client_payload.version }}"
RELEASE_DATE: ${{ inputs.releaseDate || github.event.client_payload.releaseDate }}
MATRIX_INT: ${{ inputs.matrixInt || github.event.client_payload.matrixInt }}
PRIMARY_PLATFORMS: "aarch64_linux,aarch64_mac,x86-64_linux,x86-64_mac,x86-64_windows"
SECONDARY_PLATFORMS: "aarch64_windows,ppc64le_linux,s390x_linux,ppc64_aix"
SKIP_INTERACTIVES: "true"
HEADLESS_PLATFORMS: "aarch64_alpine-linux,riscv64_linux,x86-64_alpine-linux"
SKIP_LIST_1: ""
SKIP_LIST_2: ""
PIPELINE_URL: ${{ inputs.pipelineUrl || github.event.client_payload.pipelineUrl }}
run: |
set -euo pipefail

version_label="$VERSION"

if [[ "$VERSION" == "JDK8" ]]; then
PRIMARY_PLATFORMS="aarch64_linux,x86-64_linux,x86-64_mac,x86-64_windows"
SECONDARY_PLATFORMS="x86-64_alpine-linux,arm_linux,ppc64le_linux,ppc64_aix"
SKIP_LIST_1="aarch64_linux,ppc64le_linux"
SKIP_LIST_2="arm_linux,x86-64_linux"
elif [[ "$VERSION" == "JDK11" ]]; then
SECONDARY_PLATFORMS="x86-64_alpine-linux,arm_linux,ppc64le_linux,s390x_linux,ppc64_aix"
SKIP_LIST_1="arm_linux,x86-64_linux,s390x_linux,x86-64_mac"
SKIP_LIST_2="aarch64_linux,ppc64le_linux,aarch64_mac"
elif [[ "$VERSION" == "JDK17" ]]; then
SECONDARY_PLATFORMS="riscv64_linux,x86-64_alpine-linux,arm_linux,ppc64le_linux,s390x_linux,ppc64_aix"
SKIP_LIST_1="aarch64_linux,ppc64le_linux,aarch64_mac"
SKIP_LIST_2="arm_linux,x86-64_linux,s390x_linux,x86-64_mac"
else
SECONDARY_PLATFORMS="aarch64_alpine-linux,riscv64_linux,x86-64_alpine-linux,aarch64_windows,ppc64le_linux,s390x_linux,ppc64_aix"
SKIP_LIST_1="arm_linux,x86-64_linux,s390x_linux,x86-64_mac,aarch64_windows"
SKIP_LIST_2="aarch64_linux,ppc64le_linux,aarch64_mac,x86-64_windows"
fi

gh label create "$version_label" -d "Version $version_label" -c "ededed" >/dev/null 2>&1 || true

IFS=',' read -r -a primary_platforms <<< "$PRIMARY_PLATFORMS"
IFS=',' read -r -a secondary_platforms <<< "$SECONDARY_PLATFORMS"
IFS=',' read -r -a headless_platforms <<< "$HEADLESS_PLATFORMS"
IFS=',' read -r -a skip_list_1 <<< "$SKIP_LIST_1"
IFS=',' read -r -a skip_list_2 <<< "$SKIP_LIST_2"

tasks=""

for raw in "${primary_platforms[@]}"; do
platform="$(echo "$raw" | xargs)"
if [[ -z "$platform" ]]; then
continue
fi

sub_body=$(printf 'Version: %s\nPlatform: %s\nMatrix: %s\n\nChecklist:\n- [ ] Triage AQAvit tests\n- [ ] Triage TCK automated tests\n %s\n\nClose this issue when checklist completed.' "$VERSION" "$platform" "$MATRIX_INT")

if [[ "$SKIP_INTERACTIVES" == "true" ]]; then
for interactive in "${headless_platforms[@]}"; do
if [[ "$platform" == "$(echo "$interactive" | xargs)" ]]; then
echo "Adjusting issue body for non-interactive platform: $platform"
sub_body=$(printf 'Version: %s\nHeadless Platform: %s\n\nChecklist:\n- [ ] Triage AQAvit tests\n- [ ] Triage TCK automated tests\n %s\n\nClose this issue when checklist completed.' "$VERSION" "$platform")
fi
done
fi

sub_url=$(gh issue create \
--title "Triage Automated Tests for $RELEASE_DATE $VERSION - $platform" \
--body "$sub_body" \
--label "$version_label" \
--repo "$GITHUB_REPOSITORY")

tasks+="- [ ] $sub_url"$'\n'
done

secondary_tasks=""

for raw in "${secondary_platforms[@]}"; do
platform="$(echo "$raw" | xargs)"
if [[ -z "$platform" ]]; then
continue
fi

sub_body=$(printf 'Version: %s\nPlatform: %s\nMatrix: %s\n\nChecklist:\n- [ ] Triage AQAvit tests\n- [ ] Triage TCK automated tests\n %s\n\nClose this issue when checklist completed.' "$VERSION" "$platform" "$MATRIX_INT")

if [[ "$SKIP_INTERACTIVES" == "true" ]]; then
for interactive in "${headless_platforms[@]}"; do
if [[ "$platform" == "$(echo "$interactive" | xargs)" ]]; then
echo "Adjusting issue body for non-interactive platform: $platform"
sub_body=$(printf 'Version: %s\nHeadless Platform: %s\n\nChecklist:\n- [ ] Triage AQAvit tests\n- [ ] Triage TCK automated tests\n %s\n\nClose this issue when checklist completed.' "$VERSION" "$platform")
fi
done
fi

sub_url=$(gh issue create \
--title "Triage Automated Tests for $RELEASE_DATE $VERSION - $platform" \
--body "$sub_body" \
--label "$version_label" \
--repo "$GITHUB_REPOSITORY")

secondary_tasks+="- [ ] $sub_url"$'\n'
done

parent_body=$(printf 'Pipeline URL: %s\nVersion: %s\nPrimary Platforms: %s\nSecondary Platforms: %s\n\n### Primary Tasks\n\n%s\n### Secondary Tasks\n\n%s\n' "$PIPELINE_URL" "$VERSION" "$PRIMARY_PLATFORMS" "$SECONDARY_PLATFORMS" "$tasks" "$secondary_tasks")

gh issue create \
--title "$RELEASE_DATE Release AQAvit Activities - $VERSION" \
--body "$parent_body" \
--label "$version_label" \
--repo "$GITHUB_REPOSITORY"
Loading