Skip to content

Commit 4890919

Browse files
committed
Merge commit main into feature/push-for-new-head
2 parents dc46521 + 80d0c26 commit 4890919

File tree

7 files changed

+103
-49
lines changed

7 files changed

+103
-49
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: 'publish-to-artifactory'
3+
description: 'Composite action to publish to artifactory'
4+
inputs:
5+
publish-version:
6+
description: 'version to publish with'
7+
required: true
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
13+
- name: Authneticate JFrog
14+
id: jfrog
15+
if: "!startsWith(github.ref, 'refs/tags/')"
16+
uses: jfrog/setup-jfrog-cli@v4
17+
env:
18+
JF_URL: "https://consensys.jfrog.io"
19+
with:
20+
oidc-provider-name: 'github'
21+
oidc-audience: ''
22+
23+
- name: Publish Artifactory
24+
id: artifactory
25+
if: "!startsWith(github.ref, 'refs/tags/')"
26+
shell: sh
27+
run: |
28+
./gradlew artifactoryPublish -PreleaseVersion=${{ inputs.publish-version }}
29+
env:
30+
ARTIFACTORY_USER: ${{ steps.jfrog.outputs.oidc-user }}
31+
ARTIFACTORY_PASSWORD: ${{ steps.jfrog.outputs.oidc-token }}

.github/workflows/ci.yml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ jobs:
4848
path: |
4949
./
5050
!./.git/**
51+
retention-days: 5
5152

5253
unitTests:
5354
needs: assemble
5455
runs-on: ubuntu-latest
5556
env:
5657
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
57-
5858
steps:
5959
- name: Checkout
6060
uses: actions/checkout@v4
@@ -87,5 +87,41 @@ jobs:
8787
- name: Store distribution artifacts
8888
uses: actions/upload-artifact@v4
8989
with:
90-
name: distributions
91-
path: build/distributions
90+
name: jar
91+
path: 'build/libs/'
92+
93+
publishToArtifactory:
94+
needs:
95+
- assemble
96+
- unitTests
97+
runs-on: ubuntu-latest
98+
env:
99+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2
100+
environment: publish
101+
permissions:
102+
contents: write
103+
id-token: write
104+
steps:
105+
- name: Checkout
106+
uses: actions/checkout@v4
107+
108+
- name: Setup Java and Gradle
109+
id: setup-java-gradle
110+
uses: ConsenSys/github-actions/java-setup-gradle@main
111+
with:
112+
DISTRIBUTION: 'adopt'
113+
114+
- name: Download workspace
115+
uses: actions/download-artifact@v4
116+
with:
117+
name: workspace
118+
119+
- name: Determine version
120+
id: project_version
121+
uses: ConsenSys/github-actions/java-get-project-version@main
122+
123+
- name: Publish to artifactory
124+
if: "!startsWith(github.ref, 'refs/tags/')"
125+
uses: ./.github/actions/publish-to-artifactory
126+
with:
127+
publish-version: ${{ steps.project_version.outputs.specific-version }}

.github/workflows/docker-build-fleet.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
with:
5252
name: fleet
5353
path: 'build/libs/'
54+
retention-days: 5
5455

5556
besu:
5657
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,11 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v4
1818

19-
- name: Set up JDK 21
20-
uses: actions/[email protected]
19+
- name: Setup Java and Gradle
20+
id: setup-java-gradle
21+
uses: ConsenSys/github-actions/java-setup-gradle@main
2122
with:
22-
java-version: '21'
23-
distribution: 'adopt'
24-
cache: 'gradle'
25-
26-
- name: Grant execute permission for gradlew
27-
run: chmod +x gradlew
23+
DISTRIBUTION: 'adopt'
2824

2925
- name: Get the version
3026
id: get_version
@@ -36,41 +32,27 @@ jobs:
3632
- name: Test with Gradle
3733
run: ./gradlew test
3834

39-
- name: Draft Release
40-
id: create_release
41-
uses: actions/create-release@v1
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
44-
with:
45-
tag_name: ${{ github.ref }}
46-
release_name: Release ${{ github.ref }}
47-
body: 'Release of version ${{ steps.get_version.outputs.VERSION }}.'
48-
draft: false
49-
prerelease: false
35+
- name: Create release notes
36+
run: |
37+
echo "## Release ${{ github.ref_name }}" > output.md
38+
echo "./build/libs/besu-fleet-plugin-${{ steps.get_version.outputs.VERSION }}.jar" >> output.md
39+
echo "SHA256: $(sha256sum ./build/libs/besu-fleet-plugin-${{ steps.get_version.outputs.VERSION }}.jar | awk '{ print $1 }' )" >> output.md
40+
echo "" >> output.md
5041
5142
- name: Upload Release Asset
52-
id: upload-release-asset
53-
uses: actions/upload-release-asset@v1
43+
id: release_publish
44+
uses: softprops/action-gh-release@v2
5445
env:
5546
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5647
with:
57-
upload_url: ${{ steps.create_release.outputs.upload_url }}
58-
asset_path: ./build/libs/besu-fleet-plugin-${{ steps.get_version.outputs.VERSION }}.jar
59-
asset_name: besu-fleet-plugin-${{ steps.get_version.outputs.VERSION }}.jar
60-
asset_content_type: application/octet-stream
61-
62-
- name: Authneticate JFrog
63-
id: jfrog
64-
uses: jfrog/setup-jfrog-cli@v4
65-
env:
66-
JF_URL: "https://consensys.jfrog.io"
48+
name: Release ${{ github.ref_name }}
49+
body_path: output.md
50+
generate_release_notes: true
51+
fail_on_unmatched_files: true
52+
files: ./build/libs/besu-fleet-plugin-${{ steps.get_version.outputs.VERSION }}.jar
53+
54+
- name: Publish to artifactory
55+
if: "!startsWith(github.ref, 'refs/tags/')"
56+
uses: ./.github/actions/publish-to-artifactory
6757
with:
68-
oidc-provider-name: 'github'
69-
oidc-audience: ''
70-
71-
- name: Publish Artifactory
72-
id: artifactory
73-
run: ./gradlew artifactoryPublish -PreleaseVersion=${{ steps.get_version.outputs.VERSION }}
74-
env:
75-
ARTIFACTORY_USER: ${{ steps.jfrog.outputs.oidc-user }}
76-
ARTIFACTORY_PASSWORD: ${{ steps.jfrog.outputs.oidc-token }}
58+
publish-version: ${{ steps.get_version.outputs.VERSION }}

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ mkdir -p /opt/besu/plugins
7777

7878
## Release Process
7979
Here are the steps for releasing a new version of the plugin:
80-
1. Create a tag with the release version number in the format vX.Y.Z (e.g., v0.2.0 creates a release version 0.2.0).
81-
2. Push the tag to the repository.
82-
3. GitHub Actions will automatically create a draft release for the release tag.
83-
4. Once the release workflow completes, update the release notes, uncheck "Draft", and publish the release.
80+
1. Create a release from [github](https://github.com/Consensys/besu-fleet-plugin/releases). Select the branch you want and create the tag name there (click create new tag)
81+
2. GitHub Actions will automatically create the release artifacts and update the release notes
8482

8583
**Note**: Release tags (of the form v*) are protected and can only be pushed by organization and/or repository owners.

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ task plugin(dependsOn: 'jar') {
235235
description 'Alias for the jar task'
236236
}
237237

238+
task printVersion() {
239+
doFirst {
240+
println "specific-version=${calculateVersion()}"
241+
println "publish-version=${project.version}"
242+
}
243+
}
238244

239245
@Memoized
240246
def calculateVersion() {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
releaseVersion=0.2.8-SNAPSHOT
2-
besuVersion=24.5.1-local
1+
releaseVersion=0.3.8-SNAPSHOT
2+
besuVersion=25.5.0

0 commit comments

Comments
 (0)