diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..707502e --- /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: gridsuite_spreadsheet-config-server + dockerImage: docker.io/gridsuite/spreadsheet-config-server + dockerUsername: gridsuiteci + eventType: spreadsheet_config_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 9b60eb4..0000000 --- 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 verify - - - name: Run SonarCloud analysis - run: > - mvn --batch-mode -DskipTests sonar:sonar - -Dsonar.host.url=https://sonarcloud.io - -Dsonar.organization=gridsuite - -Dsonar.projectKey=gridsuite_spreadsheet-config-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/spreadsheet-config-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/spreadsheet-config-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: spreadsheet_config_server_updated diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml new file mode 100644 index 0000000..d72a669 --- /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: gridsuite_spreadsheet-config-server + dockerImage: docker.io/gridsuite/spreadsheet-config-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 0000000..08e7a5a --- /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: gridsuite_spreadsheet-config-server + dockerImage: docker.io/gridsuite/spreadsheet-config-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 }}