diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 665f3c0..2ed1ffd 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -50,33 +50,32 @@ jobs: run: | curl -Lo external-deps-versions.properties https://raw.githubusercontent.com/Azure/azure-javaee-iaas/main/external-deps-versions.properties source external-deps-versions.properties - echo "azCliVersion=${AZ_CLI_VERSION}" >> $GITHUB_ENV echo "bicepVersion=${BICEP_VERSION}" >> $GITHUB_ENV - echo "refArmttk=${ARM_TTK_REFERENCE}" >> $GITHUB_ENV - echo "refJavaee=${AZURE_JAVAEE_IAAS_REFERENCE}" >> $GITHUB_ENV - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Checkout azure-javaee-iaas - uses: actions/checkout@v2 - with: - repository: Azure/azure-javaee-iaas - path: azure-javaee-iaas - ref: ${{ env.refJavaee }} + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username + server-password: MAVEN_TOKEN # env variable for token + - name: Set Maven env + env: + MAVEN_USERNAME: github + MAVEN_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + echo "MAVEN_USERNAME=${MAVEN_USERNAME}" >> "$GITHUB_ENV" + echo "MAVEN_TOKEN=${MAVEN_TOKEN}" >> "$GITHUB_ENV" - name: Checkout arm-ttk uses: actions/checkout@v2 with: repository: Azure/arm-ttk path: arm-ttk - ref: ${{ env.refArmttk }} - name: Checkout ${{ env.repoName }} uses: actions/checkout@v2 with: path: ${{ env.repoName }} ref: ${{ github.event.inputs.ref }} - - name: Build azure-javaee-iaas - run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml - name: Build ${{ env.repoName }} run: | deployWLO=false diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index 0daaf37..5f7a20c 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -1,8 +1,14 @@ # Copyright (c) IBM Corporation. # Copyright (c) Microsoft Corporation. -name: Package ARM +name: Package ARM and Update Offer Artifact on: workflow_dispatch: + inputs: + updateOfferArtifact: + description: 'Update offer artifact' + required: true + type: boolean + default: true # Allows you to run this workflow using GitHub APIs # PERSONAL_ACCESS_TOKEN= # REPO_NAME=WASdev/azure.liberty.aro @@ -30,16 +36,7 @@ jobs: run: | curl -Lo external-deps-versions.properties https://raw.githubusercontent.com/Azure/azure-javaee-iaas/main/external-deps-versions.properties source external-deps-versions.properties - echo "azCliVersion=${AZ_CLI_VERSION}" >> $GITHUB_ENV echo "bicepVersion=${BICEP_VERSION}" >> $GITHUB_ENV - echo "refArmttk=${ARM_TTK_REFERENCE}" >> $GITHUB_ENV - echo "refJavaee=${AZURE_JAVAEE_IAAS_REFERENCE}" >> $GITHUB_ENV - - name: Checkout azure-javaee-iaas - uses: actions/checkout@v2 - with: - repository: Azure/azure-javaee-iaas - path: azure-javaee-iaas - ref: ${{ env.refJavaee }} - name: Download arm-ttk used in partner center pipeline run: | wget -O arm-template-toolkit.zip https://aka.ms/arm-ttk-azureapps @@ -53,9 +50,17 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: Build azure-javaee-iaas - run: mvn -DskipTests clean install --file azure-javaee-iaas/pom.xml - + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME # env variable for username + server-password: MAVEN_TOKEN # env variable for token + - name: Set Maven env + env: + MAVEN_USERNAME: github + MAVEN_TOKEN: ${{ secrets.GITHUB_TOKEN }} + shell: bash + run: | + echo "MAVEN_USERNAME=${MAVEN_USERNAME}" >> "$GITHUB_ENV" + echo "MAVEN_TOKEN=${MAVEN_TOKEN}" >> "$GITHUB_ENV" - name: Build and test ${{ env.repoName }} run: | cd ${{ env.repoName }} @@ -76,6 +81,7 @@ jobs: name: ${{steps.artifact_file.outputs.artifactName}} path: ${{steps.artifact_file.outputs.artifactPath}} - name: Update offer artifact + if: ${{ inputs.updateOfferArtifact == true || github.event.client_payload.updateOfferArtifact == true }} uses: microsoft/microsoft-partner-center-github-action@v3 with: offerId: ${{ env.offerId }} diff --git a/README.md b/README.md index 12e02a9..2410730 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,47 @@ 1. Install [Maven](https://maven.apache.org/download.cgi). 1. Install [`jq`](https://stedolan.github.io/jq/download/). +## Local Build Setup and Requirements +This project utilizes [GitHub Packages](https://github.com/features/packages) for hosting and retrieving some dependencies. To ensure you can smoothly run and build the project in your local environment, specific configuration settings are required. + +GitHub Packages requires authentication to download or publish packages. Therefore, you need to configure your Maven `settings.xml` file to authenticate using your GitHub credentials. The primary reason for this is that GitHub Packages does not support anonymous access, even for public packages. + +Please follow these steps: + +1. Create a Personal Access Token (PAT) + - Go to [Personal access tokens](https://github.com/settings/tokens). + - Click on Generate new token. + - Give your token a descriptive name, set the expiration as needed, and select the scopes (read:packages, write:packages). + - Click Generate token and make sure to copy the token. + +2. Configure Maven Settings + - Locate or create the settings.xml file in your .m2 directory(~/.m2/settings.xml). + - Add the GitHub Package Registry server configuration with your username and the PAT you just created. It should look something like this: + ```xml + + + + + + + github + YOUR_GITHUB_USERNAME + YOUR_PERSONAL_ACCESS_TOKEN + + + + + + + ``` + ## Steps of deployment 1. Checkout [azure-javaee-iaas](https://github.com/Azure/azure-javaee-iaas) diff --git a/pom.xml b/pom.xml index 0375054..e409a40 100644 --- a/pom.xml +++ b/pom.xml @@ -22,14 +22,13 @@ com.ibm.websphere.azure azure.liberty.aro 1.0.54 - com.microsoft.azure.iaas azure-javaee-iaas-parent - 1.0.19 + 1.0.22 - + jar ${project.artifactId} @@ -42,10 +41,26 @@ 2023-04-01 2022-04-01 2023-01-31 - 2023-08-01 + 2023-08-01 pid-8942a2f7-32d6-4b69-b504-4c2fb23fe059-partnercenter acdd32ed-5fab-54b6-8d5a-097ed3dcfcf2 d9293179-8975-5587-b29f-8f09f2832c4f + + + + github + GitHub Packages + https://maven.pkg.github.com/azure-javaee/azure-javaee-iaas + + + + + + github + GitHub Packages + https://maven.pkg.github.com/azure-javaee/azure-javaee-iaas + +