Skip to content

Commit f7efd80

Browse files
committed
Release workflow
1 parent 77fe057 commit f7efd80

2 files changed

Lines changed: 69 additions & 11 deletions

File tree

.github/workflows/do-release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Do Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-version:
7+
description: 'Version to be released (e.g. 2.3.0).'
8+
required: true
9+
next-snapshot-version:
10+
description: 'Version to be set after the release - without the -SNAPSHOT suffix (e.g. 2.4.0).'
11+
required: true
12+
13+
env:
14+
GIT_AUTHOR_NAME: Flash Gordon
15+
GIT_AUTHOR_EMAIL: <>
16+
GIT_COMMITTER_NAME: Terminator the Kitty
17+
GIT_COMMITTER_EMAIL: <>
18+
jobs:
19+
do-release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
- name: Set up Java and credentials
25+
uses: actions/setup-java@v3
26+
with:
27+
java-version: 8
28+
distribution: 'adopt'
29+
server-id: ossrh
30+
server-username: MAVEN_USERNAME
31+
server-password: MAVEN_PASSWORD
32+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
33+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
34+
cache: 'maven'
35+
36+
- name: Do the Deployment and related stuff
37+
run: |
38+
VERSION=${{ github.event.inputs.release-version }}
39+
FULL_VERSION="JSignPdf-$VERSION"
40+
NEXT_VERSION=${{ github.event.inputs.next-snapshot-version }}-SNAPSHOT
41+
TAG=JSignPdf_${VERSION//\./_}
42+
mvn -P release --batch-mode "-Dtag=${TAG}" -DdryRun=true release:prepare \
43+
"-DreleaseVersion=${VERSION}" \
44+
"-DdevelopmentVersion=${NEXT_VERSION}"
45+
mvn -P release --batch-mode -DdryRun=true release:perform
46+
docker run --rm -v "$(pwd):/mnt" \
47+
-u $(id -u):$(id -g) kwart/innosetup \
48+
/mnt/distribution/windows/create-jsignpdf-installer.sh
49+
cd distribution/target
50+
ls -R
51+
mkdir "JSignPdf-$VERSION"
52+
mv *.zip *.exe "$FULL_VERSION/"
53+
cp generated-docs/JSignPdf.pdf "$FULL_VERSION/$FULL_VERSION.pdf"
54+
cp generated-docs/ReleaseNotes.txt "$FULL_VERSION/README.txt"
55+
56+
echo "${{ secrets.SSH_PRIVATE_KEY }}" >> private_key
57+
chmod 600 private_key
58+
sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i private_key kwart@frs.sourceforge.net:/home/frs/project/jsignpdf/test <<EOF
59+
put -R "${FULL_VERSION}"
60+
exit
61+
EOF
62+
env:
63+
MAVEN_USERNAME: ${{ secrets.SONATYPE_OSS_USERNAME }}
64+
MAVEN_PASSWORD: ${{ secrets.SONATYPE_OSS_PASSWORD }}
65+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

.github/workflows/push-snapshots.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Apache Maven Central
18-
uses: actions/setup-java@v2
16+
- uses: actions/checkout@v3
17+
- name: Set up Java and credentials
18+
uses: actions/setup-java@v3
1919
with:
2020
java-version: 8
2121
distribution: 'adopt'
@@ -24,14 +24,7 @@ jobs:
2424
server-password: MAVEN_PASSWORD
2525
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
2626
gpg-passphrase: MAVEN_GPG_PASSPHRASE
27-
28-
- name: Cache Maven packages
29-
uses: actions/cache@v2
30-
with:
31-
path: ~/.m2
32-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
33-
restore-keys: ${{ runner.os }}-m2
34-
27+
cache: 'maven'
3528
- name: Publish to Apache Maven Central
3629
run: |
3730
PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)

0 commit comments

Comments
 (0)