-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from TransbankDevelopers/chore/migrate-travis-…
…to-github-actions
- Loading branch information
Showing
7 changed files
with
100 additions
and
24 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,36 @@ | ||
name: Build and Scan | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "*" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Java 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 8 | ||
|
||
- name: Compile | ||
run: mvn --settings scripts/settings.xml clean compile | ||
|
||
- name: Set up Java 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
|
||
- name: Run SonarCloud analysis | ||
run: mvn --settings scripts/settings.xml sonar:sonar -Dsonar.token=$SONAR_TOKEN -Dsonar.projectKey=TransbankDevelopers_transbank-pos-sdk-java |
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,45 @@ | ||
name: Release to Mave | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
TAG: ${{ github.event.release.tag_name }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
GPG_SECRET_KEYS: ${{ secrets.GPG_SECRET_KEYS }} | ||
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
GPG_EXECUTABLE: ${{ secrets.GPG_EXECUTABLE }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
steps: | ||
- name: Use checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Java 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 8 | ||
|
||
- name: Import GPG keys | ||
run: | | ||
echo $GPG_SECRET_KEYS | base64 --decode | gpg --import | ||
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust | ||
- name: Build with Jacoco | ||
run: mvn --settings scripts/settings.xml clean org.jacoco:jacoco-maven-plugin:prepare-agent package org.jacoco:jacoco-maven-plugin:report | ||
|
||
- name: Deploy | ||
run: | | ||
chmod +x scripts/deploy.sh | ||
./scripts/deploy.sh | ||
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -z "$TAG" ] | ||
then | ||
echo "Tag found" | ||
if ( echo $TAG | egrep -i '^v[0-9]+\.[0-9]+\.[0-9]+') | ||
then | ||
VERSION_NUMBER=${TAG:1} | ||
echo "on a tag -> set pom.xml <version> to $VERSION_NUMBER" | ||
mvn --settings scripts/settings.xml org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$VERSION_NUMBER 1>/dev/null 2>/dev/null | ||
else | ||
echo "Tag does not start with v: ${TAG} keep snapshot version in pom.xml" | ||
fi | ||
mvn clean deploy --settings scripts/settings.xml -B -U | ||
else | ||
echo "not on a tag no deploy trigered" | ||
fi |
File renamed without changes.
This file was deleted.
Oops, something went wrong.