-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Publish maven artifacts to GH Packages
Provide reusable maven ci workflow. Publish `maven-conf` and `org.eclipse.theia.cloud.common`. Update `actions/setup-java@v3` to `actions/setup-java@v4`.
- Loading branch information
Showing
6 changed files
with
135 additions
and
1 deletion.
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,24 @@ | ||
name: Maven org.eclipse.theia.cloud.common CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "java/common/**" | ||
pull_request: | ||
branches: | ||
- main | ||
# paths: | ||
# - "java/common/**" | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
call-reusable-maven-workflow: | ||
permissions: | ||
packages: write | ||
uses: ./.github/workflows/reusable-maven.yml | ||
with: | ||
path_to_package: common/org.eclipse.theia.cloud.common/ |
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,24 @@ | ||
name: Maven config CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "java/common/maven-conf/**" | ||
pull_request: | ||
branches: | ||
- main | ||
# paths: | ||
# - "java/common/maven-conf/**" | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
call-reusable-maven-workflow: | ||
permissions: | ||
packages: write | ||
uses: ./.github/workflows/reusable-maven.yml | ||
with: | ||
path_to_package: common/maven-conf/ |
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,70 @@ | ||
name: Reusable workflow for maven packages | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
path_to_package: | ||
required: true | ||
type: string | ||
|
||
defaults: | ||
run: | ||
working-directory: java | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "17" | ||
distribution: "temurin" | ||
|
||
- name: Verify package | ||
run: | | ||
cd ${{ inputs.path_to_package }} | ||
mvn verify | ||
check-version: | ||
runs-on: ubuntu-latest | ||
if: true || github.event_name == 'push' || github.event_name == 'release' | ||
outputs: | ||
is_snapshot_version: ${{ steps.version_check.outputs.is_snapshot_version }} | ||
steps: | ||
- id: version_check | ||
run: | | ||
cd ${{ inputs.path_to_package }} | ||
# VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
# if [[ "$VERSION" == *-SNAPSHOT ]]; then | ||
# echo "is_snapshot_version=true" >> $GITHUB_OUTPUT | ||
# else | ||
# echo "is_snapshot_version=false" >> $GITHUB_OUTPUT | ||
# fi | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: check-version | ||
if: (github.event_name == 'push' && needs.check-version.outputs.is_snapshot_version == 'true') || (github.event_name == 'release' && needs.check-version.outputs.is_snapshot_version == 'false') | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "17" | ||
distribution: "temurin" | ||
|
||
- name: Publish package | ||
run: | | ||
cd ${{ inputs.path_to_package }} | ||
mvn --batch-mode deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
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
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