Skip to content

Commit

Permalink
Merge pull request #378 from KyleAure/fix-release-process
Browse files Browse the repository at this point in the history
Fix release build
  • Loading branch information
otaviojava authored Nov 28, 2023
2 parents f49f03a + 11d2a04 commit 43eb0f5
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 33 deletions.
7 changes: 4 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ body:
label: Specification Version
description: What version of the Concurrency Spec are you running using?
options:
- 1.0.0-M2
- 1.0.0-M1
- 1.0.0-SNAPSHOT (Locally built)
- SNAPSHOT (Locally built)
- type: textarea
validations:
required: true
attributes:
label: Bug report
value: |
placeholder: |
> Description of the bug found.
- type: textarea
attributes:
label: Additional information
value: |
placeholder: |
> Proposed solutions, code examples, ect.
8 changes: 3 additions & 5 deletions .github/ISSUE_TEMPLATE/certification.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Platform Certification
description: Jakarta Data Platform Certification
title: "[Certification]: "
labels: ["certification"] #TODO need to add this label
labels: ["certification"] #Verified - label exists
body:
- type: markdown
attributes:
value: |
Before submitting a Platform Certification to the Jakarta Data community
please read and be familiar with the
[TCK Process document](https://jakarta.ee/committees/specification/tckprocess)
which may be updated occasionally.
> Before submitting a Platform Certification to the Jakarta Data community please read and be familiar with the
> [TCK Process document](https://jakarta.ee/committees/specification/tckprocess) which may be updated occasionally.
- type: input
id: organization
validations:
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/clarification.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Clarification
description: Request that some aspect of the specification be clarified.
title: "[Clarification]: "
title: "[clarification]: "
labels: ["question"] #Verified - label exists
body:
- type: markdown
Expand All @@ -21,10 +21,10 @@ body:
required: true
attributes:
label: I need clarification on ...
value: |
placeholder: |
> Description of the clarification needed.
- type: textarea
attributes:
label: Additional information
value: |
placeholder: |
> Proposed solutions, code examples, ect.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Release
description: Propose a new minor/major release
description: Propose a new major/minor/milestone release
title: "[Release]: "
labels: ["release"] #Verified - label exists
body:
Expand All @@ -20,7 +20,7 @@ body:
label: Outstanding work
description: |
Issues / pulls to finish before this release can become generally available.
placeholder: |
value: |
- [ ]
validations:
required: false
Expand All @@ -34,7 +34,7 @@ body:
#### Prepare
- [X] Open this issue.
- [ ] Complete outstanding work
- [ ] (Update TCK Signatures to capture API changes)[https://github.com/jakartaee/data/blob/main/tck/src/main/java/ee/jakarta/tck/data/framework/signature/README.md#generating-the-signature-file]
- [ ] (Update TCK Signatures to capture API changes)[https://github.com/jakartaee/data/actions/workflows/release.yml]
#### Stage release
- [ ] [Update the CHANGELOG.adoc file to reflect the changes put into the new release](https://github.com/jakartaee/data/blob/main/CHANGELOG.adoc)
- [ ] [Build and stage artifacts to staging repository](https://ci.eclipse.org/data/view/Release%20Builds/job/jakarta-data-build-and-stage/)
Expand Down
17 changes: 8 additions & 9 deletions .github/ISSUE_TEMPLATE/tck-challenge.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: TCK Challenge
description: Jakarta Data TCK Challenge
title: "[TCK Challenge]: "
labels: ["challenge"] #TODO need to add this label
labels: ["challenge"] #Verified - label exists
body:
- type: markdown
attributes:
value: |
Before submitting a TCK Challenge to the Jakarta Data community
please read and be familiar with the
[TCK Process document](https://jakarta.ee/committees/specification/tckprocess)
which may be updated occasionally.
> Before submitting a TCK Challenge to the Jakarta Data community please read and be familiar with the
> [TCK Process document](https://jakarta.ee/committees/specification/tckprocess) which may be updated occasionally.
- type: input
id: specification
validations:
Expand All @@ -35,9 +33,10 @@ body:
attributes:
label: TCK Version
description: What version of the TCK are you running against?
options: #TODO need to update this list per release
- 1.0.0-M1 (Generally available)
- 1.0.0-SNAPSHOT (Locally built)
options:
- 1.0.0-M2
- 1.0.0-M1
- SNAPSHOT (Locally built)
- type: input
id: implementation
validations:
Expand Down Expand Up @@ -69,7 +68,7 @@ body:
description: |
Describe the challenge in full detail including logs.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
value: |
placeholder: |
> Description of issue using markdown syntax
- type: textarea
id: additionalContext
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/use-case.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
- type: markdown
attributes:
value: |
Describe a new use case for the specification.
> Describe a new use case for the specification.
- type: checkboxes
attributes:
label: As a ...
Expand All @@ -20,17 +20,17 @@ body:
required: true
attributes:
label: I need to be able to ...
value: |
placeholder: |
> Description of the new or different use case
- type: textarea
validations:
required: true
attributes:
label: Which enables me to ...
value: |
placeholder: |
> Description of the added value of this use case
- type: textarea
attributes:
label: Additional information
value: |
placeholder: |
> Proposed solutions, code examples, ect.
18 changes: 18 additions & 0 deletions .github/scripts/checkout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo "The checkout.sh script requires exactly 1 argument"
exit 1
fi

branch=$1

if [ "$(git ls-remote --heads origin refs/heads/$branch | wc -l)" -eq "1" ]; then
git fetch origin
git checkout -t origin/$branch
echo "branch_existed=true" >> $GITHUB_OUTPUT
else
git checkout main
git checkout -b $branch
echo "branch_existed=false" >> $GITHUB_OUTPUT
fi
4 changes: 3 additions & 1 deletion .github/workflows/java-CI.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ permissions:

jobs:
build:

# TODO update once 25-ea is available
strategy:
matrix:
java-version: [ '17', '21' ]
java-version: [ '21' ]

runs-on: ubuntu-latest

Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a reusable workflow for creating a pull request for an existing branch in github

name: Create a pull request

on:
workflow_call:
inputs:
branch:
required: true
type: string
title:
required: true
type: string
body:
required: true
type: string

jobs:
pull:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Check branch
id: check
run: .github/scripts/checkout.sh ${{ inputs.branch }}
- name: Create pull request
if: steps.check.outputs.branch_existed == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--base main \
--head ${{ inputs.branch }} \
--title "${{ inputs.title }}" \
--body "${{ inputs.body }}" \
--label 'bot'
23 changes: 18 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,42 @@ on:
types: [published]

jobs:
build:
update:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Create branch
run: |
git checkout -b update-templates
id: checkout
run: .github/scripts/checkout.sh update-templates-${{ github.sha }}
- name: Insert release - ${{ github.event.release.tag_name }}
uses: mikefarah/yq@1cf9ecc79df9cabe69ae75a0bbfa7df7f9fe8a2f #v4.40.2
with:
cmd: |
yq -i '( .body.[] | select(.id == "version") ) ref $x | $x .attributes.options = ["${{ github.event.release.tag_name }}"] + $x .attributes.options' .github/ISSUE_TEMPLATE/bug-report.yml &&
yq -i '( .body.[] | select(.id == "version") ) ref $x | $x .attributes.options = ["${{ github.event.release.tag_name }}"] + $x .attributes.options' .github/ISSUE_TEMPLATE/tck-challenge.yml
- name: Create Pull Request
- name: Needs updates
id: update
run: echo "update_count=$(git status -s -uno | wc -l)" >> $GITHUB_OUTPUT
- name: Create commit
if: steps.update.outputs.update_count > 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .github/ISSUE_TEMPLATE/bug-report.yml
git add .github/ISSUE_TEMPLATE/tck-challenge.yml
git commit -m "Update templates to include release ${{ github.event.release.tag_name }}"
git push origin update-templates
gh pr create -B main --title 'Update templates to include release ${{ github.event.release.tag_name }}' --body 'Created by Github action' --label 'version'
pull-request:
needs: [update]
uses: ./.github/workflows/pull-request.yml
with:
branch: 'update-templates-${{ github.sha }}'
title: 'Update templates to include release ${{ github.event.release.tag_name }}'
body: 'generated pull request'
53 changes: 53 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow automates the deployment of generated files

name: Update generated files

on: workflow_dispatch

jobs:
update:
runs-on: ubuntu-latest

# TODO update once 25-ea is available
strategy:
max-parallel: 1
matrix:
java-version: [ '17', '21' ]

steps:
- name: Checkout source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven
- name: Checkout branch
id: checkout
run: .github/scripts/checkout.sh update-generated-files-${{ github.sha }}
- name: Generate signatures
run: mvn package -Psignature-generation --file tck/pom.xml
## Add any other automated update steps here
- name: Needs updates
id: update
run: echo "update_count=$(git status -s -uno | wc -l)" >> $GITHUB_OUTPUT
- name: Create commit
if: steps.update.outputs.update_count > 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add tck/src/main/resources/
git commit -m "Update generated files ${{ matrix.java-version }}"
git push origin update-generated-files-${{ github.sha }}
pull-request:
needs: [update]
uses: ./.github/workflows/pull-request.yml
with:
branch: 'update-generated-files-${{ github.sha }}'
title: 'Update generated files'
body: 'generated pull request'

0 comments on commit 43eb0f5

Please sign in to comment.