From 757621c00f75e3cf8c10258bdfbda89ff7fb42e2 Mon Sep 17 00:00:00 2001 From: Joris Mancini Date: Wed, 23 Oct 2024 17:08:55 +0200 Subject: [PATCH] chore: switch to common automated workflows from powsybl Signed-off-by: Joris Mancini --- .github/workflows/build.yml | 21 +++ .github/workflows/maven.yml | 61 -------- .github/workflows/patch.yml | 24 +++ .github/workflows/release.yml | 27 ++++ .../changesets/changelog_20240215141429.xml | 147 ++++++++++++++++++ 5 files changed, 219 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/maven.yml create mode 100644 .github/workflows/patch.yml create mode 100644 .github/workflows/release.yml create mode 100644 src/main/resources/db/changelog/changesets/changelog_20240215141429.xml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..c4d40d682 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: CI + +on: + push: + branches: + - 'main' + pull_request: + +jobs: + build: + uses: powsybl/github-ci/.github/workflows/build-generic.yml@baf0d2ed84b70d359132693880d5e530cd93f168 + with: + sonarOrganization: gridsuite + sonarProjectKey: org.gridsuite:network-modification-server + dockerImage: docker.io/gridsuite/network-modification-server + dockerUsername: gridsuiteci + eventType: network_modification_server_updated + secrets: + sonar-token: ${{ secrets.SONAR_TOKEN }} + docker-token: ${{ secrets.DOCKERHUB_TOKEN }} + repo-token: ${{ secrets.REPO_ACCESS_TOKEN }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index e63b2f3dd..000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: CI - -on: - push: - branches: - - 'main' - tags: - - 'v[0-9]*' - pull_request: - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - - name: Checkout sources - uses: actions/checkout@v1 - - - name: Build with Maven - run: mvn --batch-mode -P jacoco,perform-integration-test install - - - name: Run SonarCloud analysis - run: > - mvn --batch-mode -DskipTests sonar:sonar - -Dsonar.host.url=https://sonarcloud.io - -Dsonar.organization=gridsuite - -Dsonar.projectKey=org.gridsuite:network-modification-server - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - - - name: Build Docker image - Main - if: github.ref == 'refs/heads/main' - run: > - mvn --batch-mode deploy -DskipTests -Dmaven.install.skip -Dmaven.deploy.skip -Dpowsybl.docker.deploy - -Djib.httpTimeout=60000 - -Djib.to.image=docker.io/gridsuite/network-modification-server - -Djib.to.auth.username=gridsuiteci - -Djib.to.auth.password=${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build Docker image - Tag - if: startsWith(github.ref, 'refs/tags/') - run: > - mvn --batch-mode deploy -DskipTests -Dmaven.install.skip -Dmaven.deploy.skip -Dpowsybl.docker.deploy - -Djib.httpTimeout=60000 - -Djib.to.image=docker.io/gridsuite/network-modification-server:${GITHUB_REF_NAME#v} - -Djib.to.auth.username=gridsuiteci - -Djib.to.auth.password=${{ secrets.DOCKERHUB_TOKEN }} - - - name: Broadcast update event - if: github.ref == 'refs/heads/main' - uses: gridsuite/broadcast-event@main - with: - token: ${{ secrets.REPO_ACCESS_TOKEN }} - event-type: network_modification_server_updated diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml new file mode 100644 index 000000000..b13bdf833 --- /dev/null +++ b/.github/workflows/patch.yml @@ -0,0 +1,24 @@ +name: Patch + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: version to patch (vX.X) + required: true + +jobs: + run-patch: + uses: powsybl/github-ci/.github/workflows/patch-generic.yml@baf0d2ed84b70d359132693880d5e530cd93f168 + with: + githubappId: ${{ vars.GRIDSUITE_ACTIONS_APPID }} + sonarOrganization: gridsuite + sonarProjectKey: org.gridsuite:network-modification-server + dockerImage: docker.io/gridsuite/network-modification-server + dockerUsername: gridsuiteci + releaseVersion: ${{ github.event.inputs.releaseVersion }} + secrets: + githubappPrivateKey: ${{ secrets.GRIDSUITE_ACTIONS_SECRET }} + sonar-token: ${{ secrets.SONAR_TOKEN }} + docker-token: ${{ secrets.DOCKERHUB_TOKEN }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..a99cb8c4e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + workflow_dispatch: + inputs: + releaseVersion: + description: Release version (vX.X) + required: true + gitReference: + description: SHA of the commit from where to release or branch name + required: true + +jobs: + run-release: + uses: powsybl/github-ci/.github/workflows/release-generic.yml@baf0d2ed84b70d359132693880d5e530cd93f168 + with: + githubappId: ${{ vars.GRIDSUITE_ACTIONS_APPID }} + sonarOrganization: gridsuite + sonarProjectKey: org.gridsuite:network-modification-server + dockerImage: docker.io/gridsuite/network-modification-server + dockerUsername: gridsuiteci + releaseVersion: ${{ github.event.inputs.releaseVersion }} + gitReference: ${{ github.event.inputs.gitReference }} + secrets: + githubappPrivateKey: ${{ secrets.GRIDSUITE_ACTIONS_SECRET }} + sonar-token: ${{ secrets.SONAR_TOKEN }} + docker-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/src/main/resources/db/changelog/changesets/changelog_20240215141429.xml b/src/main/resources/db/changelog/changesets/changelog_20240215141429.xml new file mode 100644 index 000000000..26213dc7d --- /dev/null +++ b/src/main/resources/db/changelog/changesets/changelog_20240215141429.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +