Skip to content

Merge pull request #13 from arumugamsubramanian/main #21

Merge pull request #13 from arumugamsubramanian/main

Merge pull request #13 from arumugamsubramanian/main #21

Workflow file for this run

# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Release Pipeline
permissions:
contents: write
packages: write
on:
push:
branches:
- release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Prepare a build
run: |
echo "$MAVEN_HOME"
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/commons-core-automation.jar -DgroupId=com.snc -DartifactId=commons-core-automation -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/snc-automation-api.jar -DgroupId=com.snc -DartifactId=snc-automation-api -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/commons-glide.jar -DgroupId=com.snc -DartifactId=commons-glide -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/gson.jar -DgroupId=com.google.code.gson -DartifactId=gson -Dversion=2.8.2 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/guava.jar -DgroupId=com.google.guava -DartifactId=guava -Dversion=2.8.2 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/mid.jar -DgroupId=com.snc -DartifactId=mid -Dversion=19.0.0.0 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file -Dfile=libs/azure-core-http-okhttp-1.11.6.jar -DgroupId=com.azure.local -DartifactId=azure-core-http-okhttp -Dversion=1.11.6 -Dpackaging=jar -DlocalRepositoryPath=$HOME/.m2/repository
- name: Delete file
run: |
rm -rf "$HOME/.m2/repository/com/snc/commons-core-automation/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/snc-automation-api/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/commons-glide/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/google/code/gson/gson/2.8.2/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/google/guava/guava/2.8.2/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/mid/19.0.0.0/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/azure/local/azure-core-http-okhttp/1.11.6/_remote.repositories"
rm -rf "$HOME/.m2/repository/com/snc/commons-core-automation/19.0.0.0/commons-core-automation-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/snc/snc-automation-api/19.0.0.0/snc-automation-api-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/snc/commons-glide/19.0.0.0/commons-glide-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/google/code/gson/gson/2.8.2/gson-2.8.2.pom"
rm -rf "$HOME/.m2/repository/com/google/guava/guava/2.8.2/guava-2.8.2.pom"
rm -rf "$HOME/.m2/repository/com/snc/mid/19.0.0.0/mid-19.0.0.0.pom"
rm -rf "$HOME/.m2/repository/com/azure/local/azure-core-http-okhttp/1.11.6/azure-core-http-okhttp-1.11.6.pom"
# - name: Build with Maven
# run: mvn -B package --file pom.xml
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Get version
run: |
VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout )
echo "VERSION=$VERSION"
echo "SEMANTIC_VERSION=$(echo $VERSION | cut -d'-' -f1)" >> $GITHUB_ENV
- name: Publish to GitHub Packages Apache Maven
run: mvn -B release:prepare release:perform -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: Version ${{ env.SEMANTIC_VERSION }}
tag_name: ecs-multi-secret-vault-credential-resolver-${{ env.SEMANTIC_VERSION }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload artifact to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/ecs-multi-secret-vault-credential-resolver-${{ env.SEMANTIC_VERSION }}.jar
asset_name: ecs-multi-secret-vault-credential-resolver-${{ env.SEMANTIC_VERSION }}.jar
asset_content_type: application/java-archive