From f9b70bd5266a1ceb9ce8767cfeae8f537b7de4c5 Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Sun, 13 Aug 2023 00:07:38 +0200 Subject: [PATCH 1/5] Testing upload --- .github/workflows/foo.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/foo.yml diff --git a/.github/workflows/foo.yml b/.github/workflows/foo.yml new file mode 100644 index 00000000..4ea85d20 --- /dev/null +++ b/.github/workflows/foo.yml @@ -0,0 +1,24 @@ +name: Test + +on: + workflow_dispatch: + inputs: + release-version: + description: 'Version to be released (e.g. 2.3.0).' + required: true + +jobs: + do-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: deploy file to server + uses: wlixcc/SFTP-Deploy-Action@v1.2.4 + with: + username: 'kwart' + server: 'frs.sourceforge.net' + ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + local_path: './distribution/licenses/*' + remote_path: /home/frs/project/jsignpdf/test/foo-${{ github.event.inputs.release-version }} + sftpArgs: '-o ConnectTimeout=5' From 86beb2d99d7c0776f99ad93787c53ca5b4de641b Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Sun, 13 Aug 2023 00:10:01 +0200 Subject: [PATCH 2/5] GH workflow update --- .github/workflows/push-snapshots.yaml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/push-snapshots.yaml b/.github/workflows/push-snapshots.yaml index 58b1f8f5..21ebd114 100644 --- a/.github/workflows/push-snapshots.yaml +++ b/.github/workflows/push-snapshots.yaml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Apache Maven Central - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - name: Set up Java and credentials + uses: actions/setup-java@v3 with: java-version: 8 distribution: 'adopt' @@ -24,14 +24,7 @@ jobs: server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - + cache: 'maven' - name: Publish to Apache Maven Central run: | PROJECT_VERSION=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) From 164eebb57778a11a296bc0baf0f745b30d24b52a Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Sun, 13 Aug 2023 00:16:56 +0200 Subject: [PATCH 3/5] testing GHA --- .github/workflows/foo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/foo.yml b/.github/workflows/foo.yml index 4ea85d20..d116a28d 100644 --- a/.github/workflows/foo.yml +++ b/.github/workflows/foo.yml @@ -20,5 +20,6 @@ jobs: server: 'frs.sourceforge.net' ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} local_path: './distribution/licenses/*' - remote_path: /home/frs/project/jsignpdf/test/foo-${{ github.event.inputs.release-version }} + remote_path: /home/frs/project/jsignpdf/test sftpArgs: '-o ConnectTimeout=5' + sftp_only: true From 60c660569fbc7240dd4e471e893deff3ca913e09 Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Sun, 13 Aug 2023 00:26:23 +0200 Subject: [PATCH 4/5] more testing --- .github/workflows/foo.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/foo.yml b/.github/workflows/foo.yml index d116a28d..d63f07c8 100644 --- a/.github/workflows/foo.yml +++ b/.github/workflows/foo.yml @@ -13,13 +13,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: deploy file to server - uses: wlixcc/SFTP-Deploy-Action@v1.2.4 + - name: SFTP uploader + uses: wangyucode/sftp-upload-action@v2.0.2 with: - username: 'kwart' - server: 'frs.sourceforge.net' - ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - local_path: './distribution/licenses/*' - remote_path: /home/frs/project/jsignpdf/test - sftpArgs: '-o ConnectTimeout=5' - sftp_only: true + host: 'frs.sourceforge.net' + username: 'kwart' + privateKey: ${{ secrets.SSH_PRIVATE_KEY }} + localDir: './distribution/licenses' + remoteDir: '/home/frs/project/jsignpdf/test/foo-123' From e91ed9525e4ddb41e93cc63819885f8044847fcc Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Sun, 13 Aug 2023 00:37:50 +0200 Subject: [PATCH 5/5] Release test --- .github/workflows/do-release.yml | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/do-release.yml diff --git a/.github/workflows/do-release.yml b/.github/workflows/do-release.yml new file mode 100644 index 00000000..fee56677 --- /dev/null +++ b/.github/workflows/do-release.yml @@ -0,0 +1,60 @@ +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@v3 + - name: Set up Java and credentials + uses: actions/setup-java@v3 + 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 + run: | + VERSION=${{ github.event.inputs.release-version }} + NEXT_VERSION=${{ github.event.inputs.next-snapshot-version }}-SNAPSHOT + TAG=JSignPdf_${VERSION//\./_} + mvn -P release --batch-mode "-Dtag=${TAG}" -DdryRun=true release:prepare \ + "-DreleaseVersion=${VERSION}" \ + "-DdevelopmentVersion=${NEXT_VERSION}" + mvn -P release --batch-mode -DdryRun=true release:perform + cd target/checkout + docker run -it --rm -v "$(pwd):/mnt" \ + -u $(id -u):$(id -g) kwart/innosetup \ + /mnt/distribution/windows/create-jsignpdf-installer.sh + env: + MAVEN_USERNAME: ${{ secrets.SONATYPE_OSS_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.SONATYPE_OSS_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + - name: SFTP upload to SourceForge + uses: wangyucode/sftp-upload-action@v2.0.2 + with: + host: 'frs.sourceforge.net' + username: 'kwart' + privateKey: ${{ secrets.SSH_PRIVATE_KEY }} + localDir: './distribution/licenses' + remoteDir: '/home/frs/project/jsignpdf/test/JSignPdf-${{ github.event.inputs.release-version }}'