Skip to content

Do Release

Do Release #19

Workflow file for this run

name: Do Release
on:
workflow_dispatch:
inputs:
release-version:
description: 'Version to be released (e.g. 2.3.0).'
required: true
next-snapshot-version:
description: 'Version to be set after the release - without the -SNAPSHOT suffix (e.g. 2.4.0).'
required: true
env:
GIT_AUTHOR_NAME: Flash Gordon
GIT_AUTHOR_EMAIL: <>
GIT_COMMITTER_NAME: Terminator the Kitty
GIT_COMMITTER_EMAIL: <>
jobs:
do-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java and credentials
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: 'maven'
- name: Do the Deployment and related stuff
id: maven_release
run: |
VERSION=${{ github.event.inputs.release-version }}
FULL_VERSION="JSignPdf-$VERSION"
NEXT_VERSION=${{ github.event.inputs.next-snapshot-version }}-SNAPSHOT
TAG=JSignPdf_${VERSION//\./_}
set -x
mvn clean install
mvn -P release --batch-mode "-Dtag=${TAG}" release:prepare \
"-DreleaseVersion=${VERSION}" \
"-DdevelopmentVersion=${NEXT_VERSION}"
mvn -P release --batch-mode release:perform \
-DstagingProgressTimeoutMinutes=30 -Dmaven.wagon.rto=7200000 \
-Dmaven.wagon.httpconnectionManager.maxPerRoute=60 -Dmaven.wagon.httpconnectionManager.maxTotal=100
docker run --rm -v "$(pwd):/mnt" \
-u $(id -u):$(id -g) kwart/innosetup \
/mnt/distribution/windows/create-jsignpdf-installer.sh
cd distribution/target
ls -R
mkdir "JSignPdf-$VERSION"
mv *.zip *.exe "$FULL_VERSION/"
cp generated-docs/JSignPdf.pdf "$FULL_VERSION/$FULL_VERSION.pdf"
cp ../doc/ReleaseNotes.txt "$FULL_VERSION/README.txt"
echo "${{ secrets.SSH_PRIVATE_KEY }}" >> private_key
chmod 600 private_key
sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i private_key kwart@frs.sourceforge.net:/home/frs/project/jsignpdf/stable <<EOF
put -R "${FULL_VERSION}"
exit
EOF
mv "$FULL_VERSION" upload
echo "TAG=$TAG" >> $GITHUB_OUTPUT
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@483c1e56f95e88835747b1c7c60581215016cbf2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: distribution/target/upload/*
file_glob: true
tag: ${{ steps.maven_release.outputs.TAG }}
overwrite: true