-
Notifications
You must be signed in to change notification settings - Fork 23
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 #16 from eu-digital-green-certificates/feature/ci
Refactor CI
- Loading branch information
Showing
10 changed files
with
215 additions
and
68 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
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 |
---|---|---|
@@ -1,20 +1,46 @@ | ||
name: Publish package to GitHub Packages | ||
name: ci-main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Publish package | ||
run: mvn --batch-mode deploy | ||
java-version: 11 | ||
distribution: adopt | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | ||
- name: version | ||
run: >- | ||
APP_SHA=$(git rev-parse --short ${GITHUB_SHA}); | ||
APP_REV=$(git rev-list --tags --max-count=1); | ||
APP_TAG=$(git describe --tags ${APP_REV} 2> /dev/null || echo 0.0.0); | ||
APP_VERSION=${APP_TAG}-${APP_SHA}; | ||
echo "APP_SHA=${APP_SHA}" >> ${GITHUB_ENV}; | ||
echo "APP_TAG=${APP_TAG}" >> ${GITHUB_ENV}; | ||
echo "APP_VERSION=${APP_VERSION}" >> ${GITHUB_ENV}; | ||
- name: mvn | ||
run: >- | ||
mvn versions:set | ||
--batch-mode | ||
--file ./pom.xml | ||
--settings ./settings.xml | ||
--define newVersion="${APP_VERSION}"; | ||
mvn clean deploy | ||
--batch-mode | ||
--file ./pom.xml | ||
--settings ./settings.xml | ||
--define app.packages.username="${APP_PACKAGES_USERNAME}" | ||
--define app.packages.password="${APP_PACKAGES_PASSWORD}"; | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
APP_PACKAGES_USERNAME: ${{ github.actor }} | ||
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: ci-pull-request | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: 11 | ||
distribution: adopt | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | ||
- name: mvn | ||
run: >- | ||
mvn clean package | ||
--batch-mode | ||
--file ./pom.xml | ||
--settings ./settings.xml | ||
--define app.packages.username="${APP_PACKAGES_USERNAME}" | ||
--define app.packages.password="${APP_PACKAGES_PASSWORD}"; | ||
env: | ||
APP_PACKAGES_USERNAME: ${{ github.actor }} | ||
APP_PACKAGES_PASSWORD: ${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: ci-release-notes | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
release-notes: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: version | ||
run: >- | ||
APP_SHA=$(git rev-parse --short ${GITHUB_SHA}); | ||
APP_TAG=${GITHUB_REF/refs\/tags\/} | ||
APP_VERSION=${APP_TAG}; | ||
echo "APP_SHA=${APP_SHA}" >> ${GITHUB_ENV}; | ||
echo "APP_TAG=${APP_TAG}" >> ${GITHUB_ENV}; | ||
echo "APP_VERSION=${APP_VERSION}" >> ${GITHUB_ENV}; | ||
- name: release-notes | ||
run: npx github-release-notes release --override --tags ${APP_TAG} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GREN_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: ci-release | ||
on: | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: 11 | ||
distribution: adopt | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | ||
- name: version | ||
run: >- | ||
APP_SHA=$(git rev-parse --short ${GITHUB_SHA}); | ||
APP_TAG=${GITHUB_REF/refs\/tags\/} | ||
APP_VERSION=${APP_TAG}; | ||
echo "APP_SHA=${APP_SHA}" >> ${GITHUB_ENV}; | ||
echo "APP_TAG=${APP_TAG}" >> ${GITHUB_ENV}; | ||
echo "APP_VERSION=${APP_VERSION}" >> ${GITHUB_ENV}; | ||
- name: mvn | ||
run: >- | ||
mvn versions:set | ||
--batch-mode | ||
--file ./pom.xml | ||
--settings ./settings.xml | ||
--define newVersion="${APP_VERSION}"; | ||
mvn clean deploy | ||
--batch-mode | ||
--file ./pom.xml | ||
--settings ./settings.xml | ||
--define app.packages.username="${APP_PACKAGES_USERNAME}" | ||
--define app.packages.password="${APP_PACKAGES_PASSWORD}"; | ||
env: | ||
APP_PACKAGES_USERNAME: ${{ github.actor }} | ||
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: ci-sonar | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
jobs: | ||
sonar: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: 11 | ||
distribution: adopt | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }} | ||
- name: mvn | ||
run: >- | ||
mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar | ||
--batch-mode | ||
--file ./pom.xml | ||
--settings ./settings.xml | ||
--define app.packages.username="${APP_PACKAGES_USERNAME}" | ||
--define app.packages.password="${APP_PACKAGES_PASSWORD}"; | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
APP_PACKAGES_USERNAME: ${{ github.actor }} | ||
APP_PACKAGES_PASSWORD: ${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd"> | ||
<interactiveMode>false</interactiveMode> | ||
<servers> | ||
<server> | ||
<id>dgc-github</id> | ||
<username>${app.packages.username}</username> | ||
<password>${app.packages.password}</password> | ||
</server> | ||
</servers> | ||
</settings> |