Skip to content
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
58 changes: 11 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,16 @@ on:
push:
branches:
- 'main'
tags:
- 'v*.*.*'
pull_request:

jobs:
build-and-deploy:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false

- name: Build and publish Docker image
if: github.ref == 'refs/heads/main'
uses: elgohr/Publish-Docker-Github-Action@33a481be3e179353cb7793a92b57cf9a6c985860 # v4
env:
DYNAWO_VERSION: 1.6.0
with:
name: powsybl/java-dynawo
username: powsyblci
password: ${{ secrets.DOCKERHUB_TOKEN }}
buildargs: DYNAWO_VERSION
tags: "latest"

- name: Broadcast update event
if: github.ref == 'refs/heads/main'
uses: gridsuite/broadcast-event@main
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
organizations: gridsuite
event-type: java_dynawo_updated

- name: Set env
if: startsWith(github.ref, 'refs/tags/')
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV # :11, strip 'refs/tags/v'

- name: Build and publish Docker image
if: startsWith(github.ref, 'refs/tags/')
uses: elgohr/Publish-Docker-Github-Action@33a481be3e179353cb7793a92b57cf9a6c985860 # v4
env:
DYNAWO_VERSION: 1.6.0
with:
name: powsybl/java-dynawo
username: powsyblci
password: ${{ secrets.DOCKERHUB_TOKEN }}
buildargs: DYNAWO_VERSION
tags: "${{ env.RELEASE_VERSION }}"
build:
uses: powsybl/github-ci/.github/workflows/build-base-docker-image-generic.yml@0c71f00e40f49d9bbfc59acb821387e0751ab4d2
with:
dockerImage: powsybl/java-dynawo
dockerUsername: powsyblci
eventOrganizations: gridsuite
eventType: java_dynawo_updated
secrets:
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
repo-token: ${{ secrets.REPO_ACCESS_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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-base-docker-image-generic.yml@0c71f00e40f49d9bbfc59acb821387e0751ab4d2
with:
githubappId: ${{ vars.POWSYBL_ACTIONS_APPID }}
dockerImage: powsybl/java-dynawo
dockerUsername: powsyblci
releaseVersion: ${{ github.event.inputs.releaseVersion }}
secrets:
githubappPrivateKey: ${{ secrets.POWSYBL_ACTIONS_SECRET }}
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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-base-docker-image-generic.yml@0c71f00e40f49d9bbfc59acb821387e0751ab4d2
with:
githubappId: ${{ vars.POWSYBL_ACTIONS_APPID }}
dockerImage: powsybl/java-dynawo
dockerUsername: powsyblci
releaseVersion: ${{ github.event.inputs.releaseVersion }}
gitReference: ${{ github.event.inputs.gitReference }}
secrets:
githubappPrivateKey: ${{ secrets.POWSYBL_ACTIONS_SECRET }}
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM powsybl/java:3.0.0
USER root
WORKDIR /
ARG DYNAWO_VERSION
ARG DYNAWO_VERSION="1.6.0"

RUN apt-get update && \
apt-get install -y libgomp1 && \
Expand Down