Skip to content

Commit e72837c

Browse files
Merge pull request #1 from dschwartznyc/develop
test github workflow changes
2 parents 7ec8767 + 6a28062 commit e72837c

File tree

11 files changed

+191
-62
lines changed

11 files changed

+191
-62
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11+
- name: Clean up stale submodule config
12+
run: git config --file .git/config --remove-section submodule.build/common-domain-model || true
1113
- name: Set up JDK 21
1214
uses: actions/setup-java@v4
1315
with:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Build and Test JAR
2+
3+
on:
4+
push:
5+
branches: [ "develop" ]
6+
pull_request:
7+
branches: [ "develop" ]
8+
9+
jobs:
10+
build_and_test:
11+
uses: ./.github/workflows/build-and-test-core.yml

.github/workflows/build-and-test-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ on:
88

99
jobs:
1010
build_and_test:
11-
uses: ./.github/workflows/build-and-test.yml
11+
uses: ./.github/workflows/build-and-test-core.yml

.github/workflows/create-tagged-release.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/cve-scanning.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v4
20+
- name: Clean up stale submodule config
21+
run: git config --file .git/config --remove-section submodule.build/common-domain-model || true
2022
- name: Setup JDK 21
2123
uses: actions/setup-java@v4
2224
with:

.github/workflows/license-scanning-maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
runs-on: ubuntu-latest
5353
steps:
5454
- uses: actions/checkout@v4
55+
- name: Clean up stale submodule config
56+
run: git config --file .git/config --remove-section submodule.build/common-domain-model || true
5557
- name: Set up JDK 21
5658
uses: actions/setup-java@v4
5759
with:

.github/workflows/release-core.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# .github/workflows/release-core.yml
2+
name: Core Release Workflow
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
release_version:
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build_and_release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Clean up stale submodule config
18+
run: git config --file .git/config --remove-section submodule.build/common-domain-model || true
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: 'temurin'
24+
java-version: '21'
25+
cache: maven
26+
27+
- name: Get artifactId
28+
id: get_artifact_id
29+
run: |
30+
ARTIFACT_ID=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
31+
echo "artifact_id=$ARTIFACT_ID" >> $GITHUB_OUTPUT
32+
33+
- name: Set POM version to release version and build
34+
run: |
35+
echo "Updating POM version to ${{ inputs.release_version }}"
36+
mvn -B versions:set -DnewVersion=${{ inputs.release_version }}
37+
mvn -B package -Psign-artifacts
38+
39+
- name: Revert POM changes
40+
run: git checkout -- pom.xml
41+
42+
- name: Check if tag already exists and create if not
43+
id: create_tag
44+
env:
45+
RELEASE_TAG: "rosetta-dsl-v${{ inputs.release_version }}"
46+
run: |
47+
# Fetch all tags to check for existence
48+
git fetch --tags
49+
if git tag | grep -q "${{ env.RELEASE_TAG }}"; then
50+
echo "Tag ${{ env.RELEASE_TAG }} already exists, skipping tag creation."
51+
else
52+
echo "Creating and pushing tag ${{ env.RELEASE_TAG }}"
53+
git config user.name "github-actions[bot]"
54+
git config user.email "github-actions[bot]@users.noreply.github.com"
55+
git tag "${{ env.RELEASE_TAG }}"
56+
git push origin "${{ env.RELEASE_TAG }}"
57+
fi
58+
echo "TAG_NAME=${{ env.RELEASE_TAG }}" >> $GITHUB_ENV
59+
60+
- name: Create GitHub Release
61+
uses: softprops/action-gh-release@v2
62+
with:
63+
tag_name: ${{ env.TAG_NAME }}
64+
name: Release ${{ env.TAG_NAME }}
65+
files: |
66+
target/${{ steps.get_artifact_id.outputs.artifact_id }}-${{ inputs.release_version }}.jar
67+
target/${{ steps.get_artifact_id.outputs.artifact_id }}-${{ inputs.release_version }}-javadoc.jar
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# .github/workflows/release-on-dsl-version-change.yml
2+
3+
name: Release on DSL Version Change
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
check-dsl-version:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
dsl_version_changed: ${{ steps.check_dsl.outputs.dsl_version_changed }}
15+
current: ${{ steps.get_version.outputs.current }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Fetch all tags
21+
22+
- name: Clean up stale submodule config
23+
run: git config --file .git/config --remove-section submodule.build/common-domain-model || true
24+
25+
- name: Set up JDK
26+
uses: actions/setup-java@v4
27+
with:
28+
distribution: 'temurin'
29+
java-version: '21'
30+
cache: maven
31+
32+
- name: Get current DSL version from POM
33+
id: get_version
34+
run: |
35+
CURRENT=$(mvn help:evaluate -Dexpression=rosetta.dsl.version -q -DforceStdout)
36+
echo "Current DSL version: $CURRENT"
37+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
38+
39+
- name: Get latest rosetta-dsl-v* tag
40+
id: get_tag
41+
run: |
42+
TAG=$(git tag --list 'rosetta-dsl-v*' --sort=-v:refname | head -n 1)
43+
if [ -z "$TAG" ]; then
44+
TAG_VERSION=""
45+
else
46+
TAG_VERSION="${TAG#rosetta-dsl-v}"
47+
fi
48+
echo "Latest tag: $TAG"
49+
echo "Latest tag version: $TAG_VERSION"
50+
echo "tag=$TAG" >> $GITHUB_OUTPUT
51+
echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT
52+
53+
- name: Check if DSL version is different from latest tag
54+
id: check_dsl
55+
run: |
56+
CURRENT="${{ steps.get_version.outputs.current }}"
57+
TAG_VERSION="${{ steps.get_tag.outputs.tag_version }}"
58+
if [ -z "$TAG_VERSION" ]; then
59+
echo "No previous tag found. Proceeding with release."
60+
echo "dsl_version_changed=true" >> $GITHUB_OUTPUT
61+
elif [ "$CURRENT" != "$TAG_VERSION" ]; then
62+
echo "DSL version ($CURRENT) is different from latest tag ($TAG_VERSION). Proceeding with release."
63+
echo "dsl_version_changed=true" >> $GITHUB_OUTPUT
64+
else
65+
echo "DSL version ($CURRENT) matches latest tag ($TAG_VERSION). Skipping release."
66+
echo "dsl_version_changed=false" >> $GITHUB_OUTPUT
67+
fi
68+
69+
release:
70+
needs: check-dsl-version
71+
if: needs.check-dsl-version.outputs.dsl_version_changed == 'true'
72+
uses: ./.github/workflows/release-core.yml
73+
with:
74+
release_version: ${{ needs.check-dsl-version.outputs.current }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .github/workflows/release-on-tag.yml
2+
3+
name: Release on tag
4+
5+
on:
6+
push:
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Get tag name
15+
id: get_tag
16+
run: |
17+
TAG_NAME=${GITHUB_REF#refs/tags/}
18+
# Extract version from tag name (e.g., 'rosetta-dsl-v1.2.3' -> '1.2.3')
19+
RELEASE_VERSION=${TAG_NAME#rosetta-dsl-v}
20+
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
21+
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
22+
23+
- name: Call core release workflow
24+
uses: ./.github/workflows/release-core.yml
25+
with:
26+
release_version: ${{ steps.get_tag.outputs.release_version }}

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The Roadmap will be aligned to the [Rune-DSL](https://github.com/finos/rune-dsl/
9191

9292
Renovate will generate a PR when the version of the DSL has been updated at com.regnosys.rosetta:com.regnosys.rosetta. The PR will clarify whether the change succsessfully builds and passes JUNIT and Python unit testing.
9393

94-
Any maintainer can merge changes that successfully build and pass the tests. To make the revised generator available to CDM, post merge a new release tagged with the version # of the updated DSL will be required.
94+
Any maintainer can merge changes that successfully build and pass the tests.
9595

9696
Build or testing failures should be escalated to [@plamen-neykov](https://github.com/plamen-neykov) or [@dschwartznyc](https://github.com/dschwartznyc) for remediation.
9797

@@ -109,11 +109,11 @@ To submit a contribution:
109109
5. Push to the branch (`git push origin feature/fooBar`)
110110
6. Create a new Pull Request
111111

112-
*_NOTE:* Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR
112+
*NOTE:_ Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR
113113
who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged
114114
and blocked by the FINOS Clabot tool (or EasyCLA). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.
115115

116-
If you are unsure if you are covered under an existing CCLA send an email to <[email protected]>
116+
If you are unsure if you are covered under an existing CCLA send an email to [email protected]
117117

118118
## Get in touch with the Rune Python Generator Team
119119

0 commit comments

Comments
 (0)