Skip to content

Release a new tagged version #141

Release a new tagged version

Release a new tagged version #141

Workflow file for this run

name: Release a new tagged version
on:
release:
types: [ released ]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name'
required: true
TITLE:
description: 'Release name'
required: true
URL:
description: 'Release url'
required: true
AUTHOR:
description: 'Release author'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
TITLE: ${{ github.event.inputs.TITLE || github.event.release.name }}
URL: ${{ github.event.inputs.URL || github.event.release.url }}
AUTHOR: ${{ github.event.inputs.AUTHOR || github.event.release.author.name }}
jobs:
get-env:
name: Get Environment vars
runs-on: ubuntu-latest
outputs:
TAG_NAME: ${{ env.TAG_NAME }}
TITLE: ${{ env.TITLE }}
URL: ${{ env.URL }}
AUTHOR: ${{ env.AUTHOR }}
steps:
- run: |
echo Get variables
build:
name: Build
needs: [ get-env ]
if: ${{ startsWith(needs.get-env.outputs.TAG_NAME, 'v') || contains(needs.get-env.outputs.TAG_NAME, '-plugin-v') }}
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
# - name: Build
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# run: ./mvnw -B install -DskipTests -ntp
#
# - name: Publish Docker tagged version and latest version
# run: |
# ./mvnw -B deploy -DskipTests -ntp -pl wakamiti-engine/wakamiti-docker -P release,-default \
# -Ddocker.pwd=${{ secrets.WAKAMITI_DOCKER_PWD }}
#
# - name: Stage JARs into Maven Central Repository
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
# MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PWD }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSWORD }}
# run: |
# ./mvnw -B -P sonatype deploy -ntp -DskipTests=true -e \
# -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
# -DaltDeploymentRepository=ossrh::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \
# -Dsonar.organization=iti-ict \
# -Dsonar.host.url=https://sonarcloud.io
- name: Microsoft Teams Notification
uses: skitionek/notify-microsoft-teams@master
if: ${{ success() }}
with:
webhook_url: ${{ secrets.TEAMS_WEBHOOK }}
raw: >-
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"url": "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref }}/images/wakamiti-icon.svg",
"size": "medium"
}
]
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"size": "extraLarge",
"weight": "bolder",
"text": "Nueva versión ${{ needs.get-env.outputs.TITLE }}! 🎉",
"wrap": true
},
{
"type": "TextBlock",
"spacing": "none",
"text": "Publicada por ${{ needs.get-env.outputs.AUTHOR }}",
"isSubtle": true,
"wrap": true
}
],
"width": "stretch"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Ver detalles",
"url": "${{ needs.get-env.outputs.URL }}"
}
]
}
}
]
}