Skip to content

Create release

Create release #107

# This workflow will create a new release when it is called
name: Create release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Configure git for the maven release plugin
run: |
git config --global committer.email "[email protected]"
git config --global committer.name "GitHub"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Find out version
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
run: |
PROJECT_VERSION=`mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec`
CLEAN_PROJECT_VERSION=`echo "${PROJECT_VERSION%-SNAPSHOT}"`
echo "RELEASE_VERSION=${CLEAN_PROJECT_VERSION}" >> $GITHUB_ENV
echo "Generando release de la versión ${RELEASE_VERSION}"
- name: Prepare & perform release
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
run: |
mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn release:prepare -Pdeployment -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN
mvn -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn release:perform -Pdeployment
- name: Checkout tag before creating release
run: |
git checkout v${{ env.RELEASE_VERSION }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: Release_Tag_v${{ env.RELEASE_VERSION }}
name: Release ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
generate_release_notes: true
token: "${{ secrets.ACTION_TOKEN }}"
files: |
./target/epl_librarian-${{ env.RELEASE_VERSION }}.zip