-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out some reusable actions for CI and release builds
- Loading branch information
1 parent
db8b007
commit 49310f4
Showing
3 changed files
with
95 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Build | ||
description: 'Builds the project' | ||
outputs: | ||
version: | ||
description: 'Version that was built' | ||
value: ${{ steps.read-version.outputs.version }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'liberica' | ||
java-version: 17 | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Set up Gradle | ||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 | ||
with: | ||
cache-read-only: false | ||
- name: Build | ||
run: ./gradlew build | ||
shell: bash | ||
- id: read-version | ||
name: Read Version From gradle.properties | ||
run: | | ||
version=$(sed -n 's/version=\(.*\)/\1/p' gradle.properties) | ||
echo "Version is $version" | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Integration Test | ||
description: 'Integration tests the project' | ||
inputs: | ||
signing-key: | ||
description: Key to use to sign artifacts | ||
required: true | ||
signing-passphrase: | ||
description: Passphrase for the signing key | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Check out action | ||
uses: actions/checkout@v4 | ||
- name: Create artifacts to deploy | ||
run: | | ||
mkdir -p deployment-repository/com/example/module-a/1.0.0-SNAPSHOT | ||
touch deployment-repository/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT.jar | ||
touch deployment-repository/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT.pom | ||
touch deployment-repository/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT-sources.jar | ||
touch deployment-repository/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT-javadoc.jar | ||
mkdir -p deployment-repository/com/example/module-b/1.0.0-SNAPSHOT | ||
touch deployment-repository/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT.jar | ||
touch deployment-repository/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT.pom | ||
touch deployment-repository/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT-sources.jar | ||
touch deployment-repository/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT-javadoc.jar | ||
- name: Run action | ||
uses: ./ | ||
id: run | ||
with: | ||
uri: 'http://artifactory:8081/artifactory' | ||
username: 'admin' | ||
password: 'password' | ||
build-name: ${{github.action}} | ||
repository: 'example-repo-local' | ||
folder: 'deployment-repository' | ||
signing-key: ${{ inputs.signing-key }} | ||
signing-passphrase: ${{ inputs.signing-passphrase }} | ||
artifact-properties: | | ||
:/**/*.jar:not-jar=true | ||
/**/module-a-*::a=alpha | ||
/**/module-b-*::b=bravo,c=charlie | ||
- name: Download artifacts | ||
run: | | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT.jar | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT.jar.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT.pom | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT.pom.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT-sources.jar | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT-sources.jar.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT-javadoc.jar | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-a/1.0.0-SNAPSHOT/module-a-1.0.0-SNAPSHOT-javadoc.jar.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT.jar | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT.jar.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT.pom | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT.pom.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT-sources.jar | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT-sources.jar.asc | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT-javadoc.jar | ||
wget http://admin:password@localhost:8081/artifactory/example-repo-local/com/example/module-b/1.0.0-SNAPSHOT/module-b-1.0.0-SNAPSHOT-javadoc.jar.asc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters