Skip to content

Commit acd6a04

Browse files
committed
add version properties to build and use in Actions
Signed-off-by: Andre Bossert <anb0s@anbos.de>
1 parent e4bf5e2 commit acd6a04

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

.github/workflows/pull_request-or-main.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
branches:
1212
- main
1313

14+
env:
15+
DEFAULT_TARGET_PLATFORM: 'Eclipse-2021-12'
16+
1417
jobs:
1518

1619
platform:
@@ -28,12 +31,15 @@ jobs:
2831
distribution: 'temurin'
2932
cache: maven
3033
- name: 'Build for platform: ${{ matrix.target-platform }}'
31-
run: 'mvn -Dtarget.platform=${{ matrix.target-platform }} -Dsite.dir=testing clean verify'
32-
- name: 'Deploy for PR${{ github.event.pull_request.number }}'
33-
if: github.event_name == 'pull_request' && matrix.target-platform == 'Eclipse-2021-12'
34+
run: 'mvn -Dtarget.platform=${{ matrix.target-platform }} -Dsite.dir=testing clean verify'
35+
- name: Assign build.version.properties to env variable
36+
if: github.event_name == 'pull_request' && matrix.target-platform == env.DEFAULT_TARGET_PLATFORM
37+
run: cat site/target/build.version.properties >> $GITHUB_ENV
38+
- name: 'Deploy build ${{ env.build_version_full }} for PR${{ github.event.pull_request.number }}'
39+
if: github.event_name == 'pull_request' && matrix.target-platform == env.DEFAULT_TARGET_PLATFORM
3440
uses: actions/upload-artifact@v2
35-
with:
36-
name: EasyShell-update-site-PR${{ github.event.pull_request.number }}
41+
with:
42+
name: EasyShell-${{ env.build_version_full }}
3743
path: site/target/repository
3844

3945
deploy-testing:

site/packaging-p2composite.ant

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,16 @@
5757
<target name="compute.child.repository.data" depends="getMajorMinorVersion">
5858
<property name="parent.root.dir" location="../" />
5959
<property name="site.parent.dir" location="updates" />
60-
<property name="full.version" value="${unqualifiedVersion}.${buildQualifier}" />
60+
<property name="build.version.unqualified" value="${unqualifiedVersion}" />
61+
<property name="build.version.qualifier" value="${buildQualifier}" />
62+
<property name="build.version.full" value="${build.version.unqualified}.${build.version.qualifier}" />
63+
<property name="build.version.file" location="${project.build.directory}/build.version.properties" />
6164
<property name="site.composite.name" value="${site.label} ${majorMinorVersion}" />
6265
<ucfirst string="${site.dir}" to="site.dir.ucfirst" />
6366
<property name="main.site.composite.name" value="${site.label} ${site.dir.ucfirst} Versions" />
6467
<property name="main.composite.repository.directory" location="${site.parent.dir}/${site.dir}" />
6568
<property name="composite.repository.directory" value="${main.composite.repository.directory}/${majorMinorVersion}" />
66-
<property name="child.repository" value="${full.version}" />
69+
<property name="child.repository" value="${build.version.full}" />
6770
<property name="child.repository.directory" value="${composite.repository.directory}/${child.repository}/" />
6871
</target>
6972

@@ -90,6 +93,10 @@
9093
composite.repository.child="${majorMinorVersion}"
9194
/>
9295

96+
<echo file="${build.version.file}" append="false" message="build_version_unqualified=${build.version.unqualified}${line.separator}"/>
97+
<echo file="${build.version.file}" append="true" message="build_version_qualifier=${build.version.qualifier}${line.separator}"/>
98+
<echo file="${build.version.file}" append="true" message="build_version_full=${build.version.full}${line.separator}"/>
99+
93100
<copy file="${parent.root.dir}/README.md" tofile="${site.parent.dir}/index.md" overwrite="true"/>
94101
</target>
95102

0 commit comments

Comments
 (0)